Account Management API Methods

The Accounts API exposes the following methods related to individual and team account configuration and monitoring.

Refer to Getting Started for Authentication and Server information.

Team Methods#

Get Teams#

GET /team-management/v1/teams/

Returns a team count and an array of all teams in the organization of the requesting account.

Parameters#

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".

cURL with jq Example
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' | jq

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.

Parameters#

id

| PATH | REQUIRED | STRING |

The unique identifier of the team. You can look up the IDs of teams in your organization using the Get Teams endpoint.

cURL with jq Example
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' | jq

Responses#

200Success. Team info returned.
404Not found.
Sample Response
{
"id": "80d69d16ebdb4c018cc9d81ea911761a",
"name": "Sauce-Docs",
"organization": {
"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.

organization

| BODY | REQUIRED | STRING |

The unique ID of the organization under which the team is created. You can look up your organization ID using the [Get Teams(#get-teams)] endpoint.

settings

| BODY | REQUIRED | OBJECT |

The settings object specifies the concurrency allocations for the team within the organization. The available attributes are:

  • virtual_machines - INTEGER
  • real_devices - INTEGER
  • live_only - BOOLEAN Defaults to false.

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 within 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"
},
"organization": "<org-id>",
"description": "Docs QA Team"
}' | jq

Responses#

201Success. Team created.
400Bad request.
Sample Response
{
"id": "9d3460738c28491a81d7ea16704a9edd",
"name": "A-Team",
"organization": {...}
},
"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,
"links": {...}
}

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 Get 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 '' | jq

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 Get 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
  • real_devices - INTEGER
  • live_only - BOOLEAN Defaults to false.

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 within 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/' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Doc-Team",
"settings": {
"virtual_machines": "10"
},
"description": "Docs Team"
}' | jq

Responses#

201Success. Team updated.
400Bad request.
404Not found.
Sample Response
{
"id": "b3de7078b79841b59d2e54127269afe3",
"name": "Doc-Team",
"organization": {...}
},
"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,
"links": {...}
}

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 Get 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
  • real_devices - INTEGER
  • live_only - BOOLEAN Defaults to false.

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/' \
--header 'Content-Type: application/json' \
--data-raw '{
"settings": {
"virtual_machines": "25"
}
}' | jq

Responses#

200Success. Team updated.
400Bad request.
404Not found.
Sample Response
{
"id": "b3de7078b79841b59d2e54127269afe3",
"name": "Doc-Team",
"organization": {...},
"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,
"links": {...}
}

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 '' | jq

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 '' | jq

Responses#

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

User Methods#

Get Users#

GET /team-management/v1/users/

Returns a count total and array of of all users in the organization of the requesting account.

Parameters#

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.

team-name

| QUERY | OPTIONAL | STRING |

Limit results to users who belong to the specified team names. Specify multiple teams as comma-separated values.

roles

| QUERY | OPTIONAL | INTEGER |

Limit results to users who are assigned certain roles. Valid values are:

  • 1 - Organaization 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 '' | jq

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.

Parameters#

user_id

| PATH | REQUIRED | STRING |

The user's unique identifier. You can look up the IDs of users in your organization using the Get 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' | jq

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 the Sauce Labs platform.

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

organization

| BODY | REQUIRED | STRING |

The identifier of the organization to create the user's account. You can look up organization IDs by calling GET https://api.saucelabs.com/v1/organizations

role

| BODY | REQUIRED | INTEGER |

Tnew user's permission role. Valid values are:

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

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 Get Teams endpoint.

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": "<team-id>"
}' | jq

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 Get 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:

  • 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"
}' | jq

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 Get 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:

  • 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 PUT 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"first_name": "Jimmy"
}' | jq

Responses#

200Success. User updated.
401Unauthorized.
400Bad request.
404Not found.
Sample Failed 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 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 Get 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' | jq

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": "************"
}
]
}

Subscribe a User to a Team#

POST /team-management/v1/membership/

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 Get 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 Get Teams endpoint.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request POST 'https://api.us-west-1.saucelabs.com/team-management/v1/users/membership/' \
--header 'Content-Type: application/json' \
--data-raw '{
"user": "<user-id>",
"team": "<team-id>"
}' | jq

Responses#

200Success. 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 Get 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' | jq

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 Get 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' | jq

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 Get 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' | jq

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 Get 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' | jq

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 Get 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' | jq

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 Get 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' | jq

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 Get 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' | jq

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
}

Last updated on by James Tacker