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

# Get all Roles assigned to a User

> Retrieve all roles assigned to a specific user within an account, including account-level and project-level role assignments



## OpenAPI

````yaml GET /api/v1/accounts/{accountId}/roles/users/{userId}
openapi: 3.1.0
info:
  title: AuthZ Service API
  description: Authorization service for managing roles and user permissions
  version: 1.1.0
servers:
  - url: https://api.aion.xyz
    description: Production server
  - url: https://api.dev.internal.aion.xyz
    description: Staging server
security:
  - BearerAuth: []
tags:
  - name: Authorization
    description: Authorization check operations
  - name: Roles
    description: Operations related to role management
  - name: User Roles
    description: Operations related to user role queries
  - name: Role Assignments
    description: Operations for assigning, updating, and revoking roles
paths:
  /api/v1/accounts/{accountId}/roles/users/{userId}:
    get:
      tags:
        - User Roles
      summary: Get all roles assigned to a user
      description: >-
        Retrieve all roles assigned to a specific user within an account,
        including account-level and project-level role assignments
      operationId: getUserRoles
      parameters:
        - name: accountId
          in: path
          required: true
          description: The account identifier (external account ID)
          schema:
            type: string
            example: my-company-account
        - name: userId
          in: path
          required: true
          description: The user identifier (external user ID)
          schema:
            type: string
            example: john.doe
        - name: status
          in: query
          required: false
          description: Filter role assignments by status
          schema:
            $ref: '#/components/schemas/AssignmentStatus'
        - name: scope
          in: query
          required: false
          description: Filter role assignments by role scope
          schema:
            $ref: '#/components/schemas/RoleScope'
        - name: projectId
          in: query
          required: false
          description: Filter role assignments by project ID
          schema:
            type: string
            example: project-alpha
      responses:
        '200':
          description: Successfully retrieved user role assignments
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserRoleAssignment'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    AssignmentStatus:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
      description: The status of the role assignment
    RoleScope:
      type: string
      enum:
        - ACCOUNT
        - PROJECT
        - RESOURCE
      description: >
        The scope of the role:

        - ACCOUNT: Role applies at the account level (e.g., account_admin)

        - PROJECT: Role applies at the project level (e.g., project_admin,
        project_reader)

        - RESOURCE: Role applies to specific resources
    UserRoleAssignment:
      type: object
      properties:
        roleId:
          type: string
          description: Role identifier
          example: project_admin
        projectId:
          type: string
          description: >-
            Project identifier (external project ID, for project-scoped
            assignments)
          example: project-alpha
        status:
          $ref: '#/components/schemas/AssignmentStatus'
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the assignment was created
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the assignment was last updated
      required:
        - roleId
        - status
        - createdAt
        - updatedAt
    PaginationMeta:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
          example: 42
        page:
          type: integer
          description: Current page number
          example: 1
        pageSize:
          type: integer
          description: Number of items per page
          example: 20
        totalPages:
          type: integer
          description: Total number of pages
          example: 3
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code
              example: BAD_REQUEST
            message:
              type: string
              description: Error message
              example: Invalid request parameters
            details:
              type: array
              items:
                type: string
              description: Additional error details
              example:
                - projectId is required for PROJECT scoped roles
          required:
            - code
            - message
      required:
        - error
  responses:
    BadRequest:
      description: Bad request - Invalid input parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: BAD_REQUEST
              message: Invalid request parameters
              details:
                - accountId must be a valid identifier
    Unauthorized:
      description: Unauthorized - Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNAUTHORIZED
              message: Authentication required
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: FORBIDDEN
              message: Insufficient permissions to access this resource
    NotFound:
      description: Not found - Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: NOT_FOUND
              message: Resource not found
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Bearer token authentication

````