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

# List roles

> Lists company roles with active user counts. Requires `user_management.view_permissiongroup` and a plan supporting roles. The SAML-managed role is excluded.



## OpenAPI

````yaml /api-reference/openapi.json get /roles
openapi: 3.0.0
info:
  title: Corgea API
  version: 1.0.0
  description: >-
    API for interacting with Corgea's scanning and vulnerability management
    features
servers:
  - url: https://www.corgea.app/api/v1
    description: Production server
  - url: https://eu.corgea.app/api/v1
    description: EU production server
security:
  - CorgeaToken: []
  - BearerAuth: []
paths:
  /roles:
    get:
      tags:
        - Users
      summary: List roles
      description: >-
        Lists company roles with active user counts. Requires
        `user_management.view_permissiongroup` and a plan supporting roles. The
        SAML-managed role is excluded.
      operationId: listRoles
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: page_size
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 20
      responses:
        '200':
          description: Request completed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  roles:
                    type: array
                    items:
                      $ref: '#/components/schemas/CompanyRole'
                  page:
                    type: integer
                  total_pages:
                    type: integer
                  total_roles:
                    type: integer
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    CompanyRole:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        user_count:
          type: integer
        created_at:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: Invalid or missing token
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Missing or invalid authorization header
    Forbidden:
      description: Permission denied or feature unavailable
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Permission denied
  securitySchemes:
    CorgeaToken:
      type: apiKey
      in: header
      name: CORGEA-TOKEN
      description: >-
        API key for authentication API tokens belonging to inactive users are
        rejected.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth2 access token (JWT) in the Authorization header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.