---
title: "Get User Role Assignments"
url: "https://public-api-docs.cipherscale.com/apis/cipherscale-api-1/versions/fef69080-6094-4620-8bf0-16fd2de7b598/operations/UsersController_findUserRoles"
---

> Full API specification: https://public-api-docs.cipherscale.com/apis/cipherscale-api-1/versions/fef69080-6094-4620-8bf0-16fd2de7b598.md

# Get User Role Assignments

`GET` `/tenants/users/{id}/roles`

Operation ID: `UsersController_findUserRoles`

Retrieves all roles currently assigned to a specific user, including both direct role assignments and roles inherited through group memberships. This information is crucial for understanding user permissions and access levels.

## Path parameters

- `id` (string, required)

## Query parameters

- `groupsOnly` (boolean, optional)
- `rolesOnly` (boolean, optional)

## Responses

- `200`
- `401` - Unauthorized - Invalid or missing authentication token
- `403` - Forbidden - Insufficient permissions to perform this operation.
- `404` - User not found with the provided ID

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Cipherscale API
  version: "1.0"
servers:
  - url: https://public-api.cipherscale.com/qa
    description: Cipherscale Public API Server
paths:
  /tenants/users/{id}/roles:
    get:
      operationId: UsersController_findUserRoles
      summary: Get User Role Assignments
      description: Retrieves all roles currently assigned to a specific user,
        including both direct role assignments and roles inherited through group
        memberships. This information is crucial for understanding user
        permissions and access levels.
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: groupsOnly
          required: false
          in: query
          schema:
            type: boolean
        - name: rolesOnly
          required: false
          in: query
          schema:
            type: boolean
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/RoleDto"
        "401":
          description: Unauthorized - Invalid or missing authentication token
        "403":
          description: Forbidden - Insufficient permissions to perform this operation.
        "404":
          description: User not found with the provided ID
      tags:
        - Users
      security:
        - ApiKeyAuth: []
security:
  - ApiKeyAuth: []
components:
  schemas:
    RoleDto:
      type: object
      description: User role definition with specific permissions and capabilities
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the role
        createdAt:
          format: date-time
          type: string
          description: Timestamp when the role was created
        updatedAt:
          format: date-time
          type: string
          description: Timestamp when the role was last modified
        name:
          type: string
          description: Human-readable name of the role
        description:
          type: string
          description: Detailed description of the role's purpose and permissions
        deleteable:
          type: boolean
          description: Whether this role can be deleted (system roles are typically not
            deletable)
        type:
          enum:
            - OWNER
            - ADMIN
            - DEFAULT
            - BASIC
            - BILLING
            - AUDITOR
          type: string
          description: Predefined role type that determines the base permissions
      required:
        - id
        - createdAt
        - updatedAt
        - name
        - deleteable
        - type
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
```
