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

# Get Role

> Get a role by ID.

Only superadmins can view role details.

Args:
    role_id: Role ID.
    current_user: Authenticated superadmin user.
    session: Database session.

Returns:
    Role details.



## OpenAPI

````yaml get /api/v1/roles/{role_id}
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/roles/{role_id}:
    get:
      tags:
        - roles
      summary: Get Role
      description: |-
        Get a role by ID.

        Only superadmins can view role details.

        Args:
            role_id: Role ID.
            current_user: Authenticated superadmin user.
            session: Database session.

        Returns:
            Role details.
      operationId: get_role_api_v1_roles__role_id__get
      parameters:
        - name: role_id
          in: path
          required: true
          schema:
            type: integer
            title: Role Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleResponse'
        '403':
          description: Superadmin access required
        '404':
          description: Role not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RoleResponse:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - id
        - name
      title: RoleResponse
      description: |-
        Response schema for a role.

        Attributes:
            id: Role ID.
            name: Role name.
            description: Role description.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````