> ## Documentation Index
> Fetch the complete documentation index at: https://docs.occtoo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# replaceUserRoles

> Replaces a user's role in the current tenant. `NotFoundError`: the role key doesn't exist in the tenant, or the user isn't in it.



**mutation** `replaceUserRoles(input: ReplaceUserRolesInput!): ReplaceUserRolesPayload!`

## Arguments

**`input`**: `ReplaceUserRolesInput!` (required)

## Returns

`ReplaceUserRolesPayload!`

**`empty`**: `Empty`

---

**`errors`**: `[ReplaceUserRolesError!]`

## Examples

```graphql Mutation
mutation ReplaceUserRoles($input: ReplaceUserRolesInput!) {
  replaceUserRoles(input: $input) {
    empty {
      value
    }
    errors {
      __typename
      ... on GraphQlError {
        code
        details {
          __typename
        }
        message
      }
    }
  }
}
```

```json Variables
{
  "input": {
    "id": "id",
    "roles": [
      "string"
    ]
  }
}
```

```json Response
{
  "data": {
    "replaceUserRoles": {
      "empty": {
        "value": 1
      },
      "errors": [
        {
          "__typename": "GraphQlError",
          "code": "string",
          "details": [
            {
              "__typename": "KeyValuePairOfStringAndString"
            }
          ],
          "message": "string"
        }
      ]
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.