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

# Rollen auflisten

> Liste die Systemrollen und benutzerdefinierten Rollen auf, die du mit der User Management API zuweisen kannst

Mit diesem Endpunkt listest du die Systemrollen und die benutzerdefinierten Rollen auf, die du mit [Nutzerrolle ändern](/de/developer/user-management-api/update-user-role.md) zuweisen kannst. Namen benutzerdefinierter Rollen sind nicht eindeutig. Nimm beim Zuweisen die `id`.

Der Aufruf ist über den `USER_MANAGEMENT_API` Scope des Workspace-API-Schlüssels autorisiert. Er läuft nicht als die Person, die den Schlüssel erstellt hat, und funktioniert weiter, wenn dieser Admin den Workspace verlässt.

## Basis-URL

```
https://api.langdock.com/user-management/v1/roles
```

> [!WARNING]
>
> **Dedicated Deployments**
>
> Ersetze `api.langdock.com` durch `<your-deployment-url>/api/public` in allen Anfragen.

## Voraussetzungen

* **API-Schlüssel** mit dem Scope `USER_MANAGEMENT_API`
* Der API-Schlüssel muss von einem Workspace-Admin erstellt worden sein

## Verhalten

* Zuerst kommen die Systemrollen, in dieser Reihenfolge: `member`, `editor`, `admin`. `kind` ist `system`. `name` ist Member, Editor oder Admin. `description` ist leer. `id` ist dieser kleingeschriebene Rollenname.
* Danach folgen die benutzerdefinierten Rollen, die älteste zuerst. `kind` ist `custom`. Gelöschte benutzerdefinierte Rollen fehlen.
* Jede Rolle hat `id`, `kind`, `name` und `description`. Berechtigungseinstellungen sind nicht enthalten.
* Der Aufruf nimmt keine Parameter.

> [!NOTE]
>
> Langdock blockiert bewusst Browser-basierte Anfragen, um deinen API-Schlüssel zu schützen und die Sicherheit deiner Anwendungen zu gewährleisten. Weitere Informationen findest du in unserem Guide zu [Best Practices für API-Schlüssel](/de/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices.md).


## OpenAPI

````yaml GET /user-management/v1/roles
openapi: 3.0.0
info:
  title: Langdock API
  version: 3.0.0
servers:
  - url: https://api.langdock.com
    description: Production
security:
  - bearerAuth: []
paths:
  /user-management/v1/roles:
    get:
      tags:
        - User Management
      summary: List assignable roles
      description: >
        Lists the workspace system roles and custom roles you can assign

        with Update User Role. System roles come first (`member`, `editor`,
        `admin`),

        then custom roles from oldest to newest. Each role includes `id`,
        `kind`,

        `name`, and `description`. Permission settings are not included.

        Custom role names are not unique, so use `id` when assigning a role.

        Requires an API key with the `USER_MANAGEMENT_API` scope.
      parameters: []
      responses:
        '200':
          description: Assignable roles
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListRolesResponse'
              examples:
                roles:
                  summary: System roles and one custom role
                  value:
                    roles:
                      - id: member
                        kind: system
                        name: Member
                        description: ''
                      - id: editor
                        kind: system
                        name: Editor
                        description: ''
                      - id: admin
                        kind: system
                        name: Admin
                        description: ''
                      - id: 33333333-3333-4333-8333-333333333333
                        kind: custom
                        name: Support lead
                        description: Can view analytics and governance
        '401':
          description: API key is missing, invalid, or expired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserManagementError'
        '403':
          description: API key is missing the USER_MANAGEMENT_API scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserManagementError'
              examples:
                insufficient_scopes:
                  summary: Missing scope
                  value:
                    message: Insufficient API key permissions.
                    error: INSUFFICIENT_SCOPES
                    details:
                      required:
                        - USER_MANAGEMENT_API
                      missing:
                        - USER_MANAGEMENT_API
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserManagementError'
components:
  schemas:
    ListRolesResponse:
      type: object
      required:
        - roles
      properties:
        roles:
          type: array
          description: |
            System roles first (`member`, `editor`, `admin`), then live custom
            roles from oldest to newest. Deleted custom roles are omitted.
          items:
            type: object
            required:
              - id
              - kind
              - name
              - description
            properties:
              id:
                type: string
                description: >
                  System role name (`member`, `editor`, or `admin`) or the
                  custom

                  role UUID. Use this value in `customRoleIds`.
                example: 33333333-3333-4333-8333-333333333333
              kind:
                type: string
                enum:
                  - system
                  - custom
                description: Whether the role is a system role or a custom role
                example: custom
              name:
                type: string
                description: Display name. Custom role names are not unique.
                example: Support lead
              description:
                type: string
                description: Role description. Empty for system roles.
                example: Can view analytics and governance
    UserManagementError:
      type: object
      properties:
        message:
          type: string
          description: Error message
          example: User not found or not an active member
      required:
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"

````

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