> ## 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 a Specific Role

> Retrieve details of a specific role by its identifier



## OpenAPI

````yaml GET /api/v1/accounts/{accountId}/roles/{roleId}
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/{roleId}:
    get:
      tags:
        - Roles
      summary: Get a specific role
      description: Retrieve details of a specific role by its identifier
      operationId: getRole
      parameters:
        - name: accountId
          in: path
          required: true
          description: The account identifier (external account ID)
          schema:
            type: string
            example: my-company-account
        - name: roleId
          in: path
          required: true
          description: The role identifier (external role ID)
          schema:
            type: string
            example: account_admin
      responses:
        '200':
          description: Successfully retrieved role
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Role'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Role:
      type: object
      properties:
        id:
          type: string
          maxLength: 50
          description: Role identifier (external_id from database)
          example: account_admin
        accountId:
          type: string
          description: Account identifier (external account ID, null for system roles)
          example: my-company-account
        projectId:
          type: string
          description: >-
            Project identifier (external project ID, for project-scoped custom
            roles)
          example: project-alpha
        name:
          type: string
          description: Role name
          example: account_admin
        description:
          type: string
          maxLength: 500
          description: Role description
          example: Full administrative access to the account
        scope:
          $ref: '#/components/schemas/RoleScope'
        status:
          $ref: '#/components/schemas/RoleStatus'
        isCustom:
          type: boolean
          description: >-
            Whether this is a custom role (false for system roles like
            account_admin, project_admin, project_reader)
        createdBy:
          type: string
          description: Creator identifier (external user ID)
          example: admin.user
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the role was created
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the role was last updated
      required:
        - id
        - name
        - scope
        - status
        - isCustom
        - createdAt
        - updatedAt
    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
    RoleStatus:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
      description: The status of the role
    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

````