Skip to content

Commit 3776f17

Browse files
committed
[IAM-6099] Document endpoint for assigning multiple teams
1 parent 85d398c commit 3776f17

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

docs/dev/api/accounts.md

+81
Original file line numberDiff line numberDiff line change
@@ -1758,6 +1758,87 @@ curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
17581758

17591759
---
17601760

1761+
### Change User's Team Assignment
1762+
1763+
<details><summary><span className="api post">PUT</span> <code>/team-management/v1/users/&#123;user_id&#125;/teams/</code></summary>
1764+
<p/>
1765+
1766+
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.
1767+
1768+
#### Parameters
1769+
1770+
<table id="table-api">
1771+
<tbody>
1772+
<tr>
1773+
<td><code>user_id</code></td>
1774+
<td><p><small>| PATH | REQUIRED | STRING |</small></p><p>The unique identifier of the Sauce Labs user. You can look up the ID of a user in your organization using the <a href="#lookup-users">Lookup Users</a> endpoint.</p></td>
1775+
</tr>
1776+
</tbody>
1777+
</table>
1778+
1779+
<Tabs
1780+
groupId="dc-url"
1781+
defaultValue="us"
1782+
values={[
1783+
{label: 'United States', value: 'us'},
1784+
{label: 'Europe', value: 'eu'},
1785+
]}>
1786+
1787+
<TabItem value="us">
1788+
1789+
```jsx title="Sample Request"
1790+
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
1791+
--request PUT 'https://api.us-west-1.saucelabs.com/team-management/v1/users/<user-id>/teams/' \
1792+
--header 'Content-Type: application/json' \
1793+
--data-raw '["<team1-id>", "<team2-id>"]' | json_pp
1794+
```
1795+
1796+
</TabItem>
1797+
<TabItem value="eu">
1798+
1799+
```jsx title="Sample Request"
1800+
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
1801+
--request PUT 'https://api.eu-central-1.saucelabs.com/team-management/v1/users/<user-id>/teams/' \
1802+
--header 'Content-Type: application/json' \
1803+
--data-raw '["<team1-id>", "<team2-id>"]' | json_pp
1804+
```
1805+
1806+
</TabItem>
1807+
</Tabs>
1808+
1809+
#### Responses
1810+
1811+
<table id="table-api">
1812+
<tbody>
1813+
<tr>
1814+
<td><code>204</code></td>
1815+
<td colSpan='2'>Success. The list of assigned teams has been properly updated.</td>
1816+
</tr>
1817+
</tbody>
1818+
<tbody>
1819+
<tr>
1820+
<td><code>400</code></td>
1821+
<td colSpan='2'>Bad Request.</td>
1822+
</tr>
1823+
</tbody>
1824+
<tbody>
1825+
<tr>
1826+
<td><code>403</code></td>
1827+
<td colSpan='2'>Requester is not authorized to perform this action.</td>
1828+
</tr>
1829+
</tbody>
1830+
<tbody>
1831+
<tr>
1832+
<td><code>404</code></td>
1833+
<td colSpan='2'>Not found.</td>
1834+
</tr>
1835+
</tbody>
1836+
</table>
1837+
1838+
</details>
1839+
1840+
---
1841+
17611842
### Subscribe a User to a Team
17621843

17631844
<details><summary><span className="api post">POST</span> <code>/team-management/v1/membership/</code></summary>

0 commit comments

Comments
 (0)