Skip to main content

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/

Queries the organization of the requesting account and returns the number of teams matching the query and a summary of each team, including the 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, id=3d60780314724ab8ac688b50aadd9ff9,f9acc7c5b1da4fd0902b184c4f0b6324 would return details of teams with IDs included in the provided list.

name

| QUERY | OPTIONAL | STRING |

Returns the set of teams that begin with the specified name value. For example, name=sauce would return all teams in the organization with names beginning with "sauce".

Sample Request
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

Responses​

200Success. Team info returned.
404Not found.
Sample Response
{
"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}/

Returns the full profile of the specified team. The 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.

Sample Request
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

Responses​

200Success. Team info returned.
404Not found.
Sample Response
{
"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/

Creates a new team under the organization of the requesting account.

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:

  • virtual_machines - INTEGER

The settings parameter is required, but you only need to include the applicable concurrency attribute(s) for the team.

description

| BODY | OPTIONAL | STRING |

A description to distinguish the team in the organization.

Sample Request
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

Responses​

201Success. Team created.
400Bad request.
Sample Response
{
"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}/

Deletes the specified team from the organization of the requesting account.

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.

Sample Request
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

Responses​

204Success. No content returned.
404Not found.

Update a Team​

PUT /team-management/v1/teams/{team_id}/

Replaces all values of the specified team with the new set of parameters passed in the request. To update only certain parameters, see Partially Update Team.

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:

  • virtual_machines - INTEGER

The settings parameter is required, but you only need to include the applicable concurrency attribute(s) for the team.

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.

Sample Request
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

Responses​

201Success. Team updated.
400Bad request.
404Not found.
Sample Response
{
"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}/

Updates one or more individual editable parameters (such as the concurrency allocation) of the specified team without requiring a full profile update.

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:

  • virtual_machines - INTEGER

description

| BODY | OPTIONAL | STRING |

An updated description.

Sample Request
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

Responses​

200Success. Team updated.
400Bad request.
404Not found.
Sample Response
{
"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/

Returns the number of members in the specified team and lists each member.

Parameters​

team_id

| PATH | REQUIRED | STRING |

Identifies the team for which you are requesting the list of members.

Sample Request
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

Responses​

200Success. Team info returned.
404Not found.
Sample Response
{
"links": {...},
"count": 0,
"results": []
}

Reset Access Keys for Entire Team​

POST /team-management/v1/teams/{team_id}/reset-access-key/

Globally regenerates new access key values for every member of the specified team.
warning

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.

Sample Request
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

Responses​

200Success. All access keys reset.
404Not found.
Sample Response
;[]

User​

Lookup Users​

GET /team-management/v1/users/

Queries the organization of the requesting account and returns the number of users matching the query and a basic profile of each user, including the 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, id=3d60780314724ab8ac688b50aadd9ff9,f9acc7c5b1da4fd0902b184c4f0b6324 would return details of users with IDs included in the provided list.

username

| QUERY | OPTIONAL | STRING |

Limits the results to usernames that begin with the specified value. For example, username=an would return all users in the organization with usernames beginning with "an".

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:

  • 1 - Organization Admin
  • 4 - Team Admin
  • 3 - Member

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:

  • active
  • pending
  • inactive

limit

| QUERY | OPTIONAL | INTEGER MAX=100 |

Limit results to a maximum number per page. Default value is 20.

offset

| QUERY | OPTIONAL | INTEGER |

The starting record number from which to return results.

Sample Request
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

Responses​

200Success. Team info returned.
404Not found.
Sample Response
{
"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}/

Returns the full profile of the specified user. The 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.

Sample Request
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

Responses​

200Success. Team info returned.
404Not found.
Sample Response
{
"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/

Creates a new user in your Sauce Labs organization.

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:

  • 1 lowercase letter
  • 1 uppercase letter
  • 1 digit
  • 1 special character
  • 8 characters minimum
  • No blank spaces

role

| BODY | OPTIONAL | INTEGER |

New user's permission role. Valid values are:

  • 1 - Organization Admin
  • 4 - Team Admin
  • 3 - Member (default)

team

| BODY | OPTIONAL | STRING |

ID of the team to assign the new user to. Must be the UUID of a team that exists in your organization. You can look up team IDs using the Lookup Teams endpoint.

  • If omitted: the user is created in the default team
  • Example: b3de7078b79841b59d2e54127269afe3
Sample Request
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": "b3de7078b79841b59d2e54127269afe3"
}' | json_pp

Responses​

201Success. User created.
401Unauthorized.
400Bad input.
404Not found.
Sample Response
{
"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}

Replaces all values of the specified user profile with the new set of parameters passed in the request. To update only certain parameters, see Partially Update a User.

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.

password

| BODY | REQUIRED | STRING |

A login password for the new user. The password requirements are:

  • 1 lowercase letter
  • 1 uppercase letter
  • 1 digit
  • 1 special character
  • 8 characters minimum
  • No blank spaces

verify_password

| BODY | REQUIRED | STRING |

A confirmation of the password. This value must match the password value in the request.

Sample Request
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

Responses​

200Success. User updated.
401Unauthorized.
400Bad request.
404Not found.
Sample Failed Response
{
"status_code": 400,
"non_field_errors": [
"Passwords need to match"
]
}

Partially Update a User​

PATCH /team-management/v1/users/{user_id}

Allows you to update individual user values without replacing the entire profile.

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.

password

| BODY | OPTIONAL | STRING |

A login password for the new user. The password requirements are:

  • 1 lowercase letter
  • 1 uppercase letter
  • 1 digit
  • 1 special character
  • 8 characters minimum
  • No blank spaces

verify_password

| BODY | OPTIONAL | STRING |

A confirmation of the password. If the password parameter is included in the call, this parameter is required and the values for both must match.

Sample Request
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

Responses​

200Success. User updated.
401Unauthorized.
400Bad request.
404Not found.
Sample Response
{
"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

Returns details about the current in-use virtual machines and real devices along with the maximum allowed values.
Real Devices

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.

Sample Request
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

Responses​

200Success. User updated.
401Unauthorized.
400Bad request.
404Not found.

Response Details​

concurrency.organization.allowedThe total allowed concurrency for each device type allocated to the organization.
concurrency.organization.currentThe total concurrency for each device type currently in use by the organization.
concurrency.team.allowedThe total concurrency for each device type allocated to the logged-in user's team.
concurrency.team.currentThe 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:

  • mac_vms - Mac virtual machines represent any live, automated, desktop, or mobile test running in a Mac OS, which includes iOS Simulator tests.
  • rds - Real devices represent any live or automated mobile test running on a Sauce Labs real device.
  • vms - Windows virtual machines represent any live, automated, desktop, or mobile test running in a Windows or Android OS, which includes Android Emulator tests.

Note that mac_vms and vms are separated here, although they are typically presented as a combined total of virtual machine usage in other areas of the Sauce Labs platform.

Sample Response
{
"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/

Returns the number of teams a user belongs to and provides information about each team, including whether it is the default and its concurrency settings.
note

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.

Sample Request
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

Responses​

200Success.
404Not found.
Sample Response
{
"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/

Assign user to one or multiple teams. New team assignments will replace the existing ones. User assigned to multiple teams will be able to switch between them.

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.

Sample Request
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

Responses​

204Success. The list of assigned teams has been properly updated.
400Bad Request.
403Requester is not authorized to perform this action.
404Not found.

Subscribe a User to a Team​

POST /team-management/v1/membership/ DEPRECATED

This endpoint is DEPRECATED. Please use Change User's Team Assignment endpoint instead.
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.

Sample Request
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

Responses​

201Success. User assigned Org Admin role.
400Bad Request.
404Not found.
Sample Response
{
"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/

Assigns administrator rights to the user within their organization. Organization Admins automatically have Team Admin rights in all the teams in the Organization.

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.

Sample Request
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

Responses​

200Success.
404Not found.
Sample Response
{
"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/

Assigns administrator rights to the user within their current team. If the user is currently assigned an Org Admin role, this call would reduce the rights to only those of a 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.

Sample Request
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

Responses​

200Success.
404Not found.
Sample Response
{
"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/

Assigns the 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.

Sample Request
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

Responses​

200Success.
404Not found.
Sample Response
{
"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/

Retrieves the Sauce Labs access key for the specified user.

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.

Sample Request
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

Responses​

200Success.
404Not found.
Sample Response
{
"id": "631dfdc7c20f499e9f9de19680543c35",
"username": "jsmith",
"access_key": "********-****-****-****-************"
}

Reset a User's Access Key​

POST /team-management/v1/users/{user_id}/reset-access-key/

Creates a new auto-generated access key for the specified user.
warning

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.

Sample Request
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

Responses​

200Success.
404Not found.
Sample Response
{
"id": "631dfdc7c20f499e9f9de19680543c35",
"username": "jsmith",
"access_key": "********-****-****-****-************"
}

Deactivate a User​

POST /team-management/v1/users/{user_id}/deactivate/

Suspends the specified user's account, preventing all access to Sauce Labs while deactivated.

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.

Sample Request
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

Responses​

200Success.
403Forbidden.
404Not found.
Sample Response
{
"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/

Re-activates the specified user's account, if it had been previously deactivated.

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.

Sample Request
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

Responses​

200Success.
403Forbidden.
404Not found.
Sample Response
{
"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/

Retrieves the Sauce Labs active team for the currently authenticated user.

Parameters​

Sample Request
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

Responses​

200Success.
403Forbidden.
404Not found.
Sample Response
{
"id": "d13cc39b78da4015aa3ca67b234ecb0b",
"name": "Team A",
}

Service account​

Enterprise Plans Only

Lookup Service Accounts​

GET /team-management/v1/service-accounts/

Lists existing service accounts in your organization. You can filter the results using the query parameters below.

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.

Sample Request
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
Sample Request with Filters
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

Responses​

200Success. Service account list returned.
403Forbidden. You do not have permission to look up service accounts.
Sample Response
{
"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}/

Retrieves details of the specified service account.

Parameters​

uuid

| PATH | REQUIRED | STRING |

The unique identifier of the service account. You can find the uuid in the URL of the service account details view in the Sauce Labs UI. You can also look up the uuid using the Lookup Service Accounts endpoint.

Sample Request
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

Responses​

200Success. Service account details returned.
403Forbidden. You do not have permission to access this resource.
404Not found. The specified service account does not exist.
Sample Response
{
"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/

Creates a new service account. Provide the required fields to generate a service account with an automatically generated username and access key.

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:

  • letters
  • digits
  • the following special characters: ', . - _ ~ ! @ # $ % ^ & * ( ) = + | / ? : ; [ ]

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.
Note: Team admins can only create accounts in their active team.

Sample Request
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

Responses​

201Success. Service account created successfully.
403Forbidden. You do not have permission to create a service account.
Sample Response
{
"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}/

Updates the details of an existing service account. You can only update the name field, which is a user-friendly, editable display name. The username remains immutable.

Parameters​

uuid

| PATH | REQUIRED | STRING |

The unique identifier of the service account. You can find the uuid in the URL of the service account details view in the Sauce Labs UI. You can also look up the uuid using the Lookup Service Accounts endpoint.

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:

  • letters
  • digits
  • the following special characters: ', . - _ ~ ! @ # $ % ^ & * ( ) = + | / ? : ; [ ]

Sample Request
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

Responses​

200Success. Service account updated successfully.
403Forbidden. You do not have permission to update this service account.
404Not found. The specified service account does not exist.
Sample Response
{
"id": "7ddb81628f5f4e77b5f74d9dec4980db",
"username": "bot-automation-service-account-d2164",
"name": "Bot Foo Bar",
}

Delete a Service Account​

DELETE /team-management/v1/service-accounts/{uuid}/

Deletes the specified service account from your organization.

Parameters​

uuid

| PATH | REQUIRED | STRING |

The unique identifier of the service account. You can find the uuid in the URL of the service account details view in the Sauce Labs UI. You can also look up the uuid using the Lookup Service Accounts endpoint.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request DELETE 'https://api.us-west-1.saucelabs.com/team-management/v1/service-accounts/<uuid>'

Responses​

204Success. Service account deleted successfully. No content returned.
403Forbidden. You do not have permission to delete this service account.
404Not found. The specified service account does not exist.

Reset Service Account Access Key​

POST /team-management/v1/service-accounts/{uuid}/reset-access-key/

Resets the access key for the specified service account. A new access key is generated and returned in the response.
warning

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 uuid in the URL of the service account details view in the Sauce Labs UI. You can also look up the uuid using the Lookup Service Accounts endpoint.

Sample Request
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

Responses​

200Success. Service account access key was rotated.
403Forbidden. You do not have permission to reset the access key for this service account.
404Not found. The specified service account does not exist.
Sample Response
{
"access_key": "3f78c473-3396-432d-b6d1-48e2dd7c57b1"
}