> ## 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.

# List Roles

> List all roles.

Only superadmins can access this endpoint.

Args:
    current_user: Authenticated superadmin user.
    session: Database session.

Returns:
    List of all roles.



## OpenAPI

````yaml get /api/v1/roles
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:
    get:
      tags:
        - roles
      summary: List Roles
      description: |-
        List all roles.

        Only superadmins can access this endpoint.

        Args:
            current_user: Authenticated superadmin user.
            session: Database session.

        Returns:
            List of all roles.
      operationId: list_roles_api_v1_roles_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleListResponse'
        '403':
          description: Superadmin access required
components:
  schemas:
    RoleListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/RoleListItem'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: RoleListResponse
      description: |-
        Response schema for listing roles.

        Attributes:
            items: List of roles.
            total: Total number of roles.
    RoleListItem:
      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: RoleListItem
      description: |-
        List item schema for a role.

        Attributes:
            id: Role ID.
            name: Role name.
            description: Role description.

````