# User team roles

The following endpoints update and retrieve data about user team roles of a user in a team. Check out the [overview of user team roles and the associated permissions](https://www.make.com/en/help/access-management/teams#managing-team-members).

## List user roles

> Gets team roles of the user with the specified \`userId\`. The response contains user's team role ID for all teams the user is part of. Get the mapping of the \`userRoleId\` and the user role \`name\` with the API call \`GET /users/roles\`.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Users / User team roles","description":"The following endpoints update and retrieve data about user team roles of a user in a team. Check out the [overview of user team roles and the associated permissions](https://www.make.com/en/help/access-management/teams#managing-team-members)."}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["user:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/users/{userId}/user-team-roles":{"get":{"tags":["Users / User team roles"],"summary":"List user roles","description":"Gets team roles of the user with the specified `userId`. The response contains user's team role ID for all teams the user is part of. Get the mapping of the `userRoleId` and the user role `name` with the API call `GET /users/roles`.","parameters":[{"name":"userId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the user."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"userTeamRoles":{"type":"array","items":{"type":"object","properties":{"usersRoleId":{"type":"integer"},"userId":{"type":"integer"},"teamId":{"type":"integer"},"changeable":{"type":"boolean"},"ssoPending":{"type":"boolean"}}}}}}}}}}}}}}
```

## Get user team role detail

> Gets user role detail in the team with the specified \`teamId\`. Get the mapping of the \`userRoleId\` and the user role \`name\` with the API call \`GET /users/roles\`.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Users / User team roles","description":"The following endpoints update and retrieve data about user team roles of a user in a team. Check out the [overview of user team roles and the associated permissions](https://www.make.com/en/help/access-management/teams#managing-team-members)."}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["user:read"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/users/{userId}/user-team-roles/{teamId}":{"get":{"tags":["Users / User team roles"],"summary":"Get user team role detail","description":"Gets user role detail in the team with the specified `teamId`. Get the mapping of the `userRoleId` and the user role `name` with the API call `GET /users/roles`.","parameters":[{"name":"userId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the user."},{"name":"teamId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the team."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"userTeamRole":{"type":"object","properties":{"usersRoleId":{"type":"integer"},"userId":{"type":"integer"},"teamId":{"type":"integer"},"changeable":{"type":"boolean"},"ssoPending":{"type":"boolean"}}}}}}}}}}}}}
```

## Update user role

> Updates the user role in the team with the specified \`teamId\`. Get the mapping of the \`userRoleId\` and the user role \`name\` with the API call \`GET /users/roles\`.

```json
{"openapi":"3.0.0","info":{"title":"Web API v2 - Public ","version":"1.0.0"},"tags":[{"name":"Users / User team roles","description":"The following endpoints update and retrieve data about user team roles of a user in a team. Check out the [overview of user team roles and the associated permissions](https://www.make.com/en/help/access-management/teams#managing-team-members)."}],"servers":[{"url":"https://eu1.make.com/api/v2","description":"EU1 production zone"},{"url":"https://eu2.make.com/api/v2","description":"EU2 production zone"},{"url":"https://us1.make.com/api/v2","description":"US1 production zone"},{"url":"https://us2.make.com/api/v2","description":"US2 production zone"},{"url":"https://eu1.make.celonis.com/api/v2","description":"Celonis EU1 production zone"},{"url":"https://us1.make.celonis.com/api/v2","description":"Celonis US1 production zone"}],"security":[{"token":["user:write"]}],"components":{"securitySchemes":{"token":{"type":"apiKey","name":"Authorization","in":"header","description":"Authorize the API call with your API token in the `Authorization` header with the value: `Token your-api-token`.\n\nIf you don't have an API token yet, please refer to the [\"Authentication\" section](/api-documentation/authentication) to learn how to create one.\n"}}},"paths":{"/users/{userId}/user-team-roles/{teamId}":{"post":{"tags":["Users / User team roles"],"summary":"Update user role","description":"Updates the user role in the team with the specified `teamId`. Get the mapping of the `userRoleId` and the user role `name` with the API call `GET /users/roles`.","parameters":[{"name":"userId","in":"path","schema":{"type":"integer"},"required":true,"description":"The ID of the user."},{"name":"teamId","in":"path","schema":{"type":"integer"},"required":true,"description":"The ID of the team."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"usersRoleId":{"type":"integer","description":"The ID of the user role. Check the `GET /users/roles` API call for the available `usersRoleId` values."}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"userTeamRole":{"type":"object","properties":{"usersRoleId":{"type":"integer"},"userId":{"type":"integer"},"teamId":{"type":"integer"},"changeable":{"type":"boolean"},"ssoPending":{"type":"boolean"}}}}}}}}}}}}}
```
