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

# Gruppe aktualisieren

> Aktualisieren Sie eine vorhandene Benutzergruppe

# Gruppe aktualisieren

Aktualisieren Sie eine vorhandene Benutzergruppe mit neuen Informationen, Beschreibungen oder Metadaten.

## Endpunkt

```
PUT /groups/{groupId}
```

## Beschreibung

Mit diesem Endpunkt können Administratoren eine vorhandene Benutzergruppe aktualisieren. Sie können den Gruppennamen, die Beschreibung, die Metadaten und andere Eigenschaften ändern. Die Gruppe muss vorhanden sein und Sie müssen über die entsprechenden Berechtigungen zum Aktualisieren verfügen.

## Authentifizierung

**Erforderlich**: API-Schlüssel mit Administratorrechten

```
Authorization: Bearer sk-your-api-key-here
```

## Pfadparameter

| Parameter | Geben Sie    | ein Erforderlich | Beschreibung                                             |
| --------- | ------------ | ---------------- | -------------------------------------------------------- |
| `groupId` | Zeichenfolge | Ja               | Der eindeutige Bezeichner der zu aktualisierenden Gruppe |

## Anforderungstext

| Parameter     | Geben Sie    | ein Erforderlich | Beschreibung                           |                          |
| ------------- | ------------ | ---------------- | -------------------------------------- | ------------------------ |
| `name`        | Zeichenfolge | Nein             | Neuer Name für die Gruppe              |                          |
| `description` | Zeichenfolge | Nein             | Neue Beschreibung für die Gruppe       |                          |
| `users`       | Array        | Nein             | Array von Benutzer-IDs, die der Gruppe | zugewiesen werden sollen |
| `status`      | Zeichenfolge | Nein             | Gruppenstatus                          |                          |

## Beispielanfrage

```json theme={null}
{
  "name": "Updated Engineering Team",
  "description": "Updated software engineering and development team",
  "users": ["60a7c8f5e8b4f5001f7a8c24", "60a7c8f5e8b4f5001f7a8c26", "60a7c8f5e8b4f5001f7a8c27"],
  "status": "Active"
}
```

## Erfolgsantwort

**Statuscode**: `200 OK`

```json theme={null}
{
  "success": true,
  "message": "Group updated successfully",
  "group": {
    "id": "60a7c8f5e8b4f5001f7a8c25",
    "name": "Updated Engineering Team",
    "description": "Updated software engineering and development team",
    "status": "Active",
    "userCount": 3,
    "users": [
      {
        "id": "60a7c8f5e8b4f5001f7a8c24",
        "name": "John Doe",
        "email": "john@example.com"
      },
      {
        "id": "60a7c8f5e8b4f5001f7a8c26",
        "name": "Jane Smith",
        "email": "jane@example.com"
      },
      {
        "id": "60a7c8f5e8b4f5001f7a8c27",
        "name": "Bob Wilson",
        "email": "bob@example.com"
      }
    ],
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-15T10:30:00.000Z"
  }
}
```

### Antwortfelder

| Feld                  | Geben Sie       | ein Beschreibung                         |
| --------------------- | --------------- | ---------------------------------------- |
| `success`             | boolescher Wert | Zeigt an, ob der Vorgang erfolgreich war |
| `message`             | Zeichenfolge    | Erfolgsmeldung                           |
| `group`               | Objekt          | Aktualisiertes Gruppenobjekt             |
| `group.id`            | Zeichenfolge    | Eindeutiger Gruppenbezeichner            |
| `group.name`          | Zeichenfolge    | Aktualisierter Gruppenname               |
| `group.description`   | Zeichenfolge    | Aktualisierte Gruppenbeschreibung        |
| `group.status`        | Zeichenfolge    | Gruppenstatus                            |
| `group.userCount`     | Ganzzahl        | Anzahl der Benutzer in der Gruppe        |
| `group.users`         | Array           | Array von Benutzerobjekten in der Gruppe |
| `group.users[].id`    | Zeichenfolge    | Benutzer-ID                              |
| `group.users[].name`  | Zeichenfolge    | Benutzername                             |
| `group.users[].email` | Zeichenfolge    | Benutzer-E-Mail                          |
| `group.createdAt`     | Zeichenfolge    | Ursprünglicher Erstellungszeitstempel    |
| `group.updatedAt`     | Zeichenfolge    | Zeitstempel der letzten Aktualisierung   |

## Beispielverwendung

### JavaScript

```javascript theme={null}
const updateGroup = async (groupId, updateData) => {
  const response = await fetch(`https://{customer.name}.hiperai.ai/api/external/groups/${groupId}`, {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer sk-your-api-key-here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(updateData)
  });
  
  return await response.json();
};

// Example usage
const updateData = {
  name: "Updated Engineering Team",
  description: "Updated software engineering and development team",
  users: ["60a7c8f5e8b4f5001f7a8c24", "60a7c8f5e8b4f5001f7a8c26", "60a7c8f5e8b4f5001f7a8c27"],
  status: "Active"
};

const result = await updateGroup('60a7c8f5e8b4f5001f7a8c25', updateData);
console.log('Updated group:', result.group);
```

### Python

```python theme={null}
import requests

def update_group(group_id, update_data):
    url = f"https://{customer.name}.hiperai.ai/api/external/groups/{group_id}"
    headers = {
        "Authorization": "Bearer sk-your-api-key-here",
        "Content-Type": "application/json"
    }
    
    response = requests.put(url, headers=headers, json=update_data)
    return response.json()

# Example usage
update_data = {
    "name": "Updated Engineering Team",
    "description": "Updated software engineering and development team",
    "users": ["60a7c8f5e8b4f5001f7a8c24", "60a7c8f5e8b4f5001f7a8c26", "60a7c8f5e8b4f5001f7a8c27"],
    "status": "Active"
}

result = update_group("60a7c8f5e8b4f5001f7a8c25", update_data)
print("Updated group:", result["group"])
```

### cURL

```bash theme={null}
curl -X PUT "https://{customer.name}.hiperai.ai/api/external/groups/60a7c8f5e8b4f5001f7a8c25" \
  -H "Authorization: Bearer sk-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Engineering Team",
    "description": "Updated software engineering and development team",
    "users": ["60a7c8f5e8b4f5001f7a8c24", "60a7c8f5e8b4f5001f7a8c26", "60a7c8f5e8b4f5001f7a8c27"],
    "status": "Active"
  }'
```

## Fehlerantworten

### 400 Ungültige Anfrage

```json theme={null}
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Group name cannot be empty",
    "details": {
      "field": "name",
      "value": ""
    }
  }
}
```

### 401 Nicht autorisiert

```json theme={null}
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}
```

### 403 Verboten

```json theme={null}
{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Cannot update this group"
  }
}
```

### 404 Nicht gefunden

```json theme={null}
{
  "success": false,
  "error": {
    "code": "GROUP_NOT_FOUND",
    "message": "Group not found"
  }
}
```

### 409 Konflikt

```json theme={null}
{
  "success": false,
  "error": {
    "code": "GROUP_NAME_EXISTS",
    "message": "Group name already exists"
  }
}
```

### 429 Zu viele Anfragen

```json theme={null}
{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded",
    "retryAfter": 60
  }
}
```

## Anwendungsfälle

* **Gruppenverwaltung**: Gruppeninformationen und -beschreibungen aktualisieren
* **Benutzerzuweisung**: Weisen Sie der Gruppe neue Benutzer zu
* **Namensänderungen**: Gruppen zur besseren Übersichtlichkeit umbenennen
* **Statusaktualisierungen**: Gruppenstatus ändern
* **Team-Updates**: Gruppeninformationen aktualisieren, wenn sich die Teamstruktur ändert

## Tarifbegrenzungen

* **Standard**: 50 Anfragen pro Minute
* **Täglich**: 5.000 Anfragen pro Tag
* **Monatlich**: 150.000 Anfragen pro Monat

## Notizen

– Auf diesen Endpunkt können nur Administratoren zugreifen

* Teilweise Aktualisierungen: Schließen Sie nur die Felder ein, die Sie ändern möchten
* Benutzerzuweisung: Kann der Gruppe neue Benutzer zuweisen
* Namensvalidierung: Gruppennamen müssen eindeutig sein
* Flache Antwort: Die Antwort ist nicht unter dem Datenobjekt verschachtelt
* Benutzervalidierung: Benutzer-IDs werden vor der Zuweisung validiert
* Der `updatedAt`-Zeitstempel wird automatisch aktualisiert


## OpenAPI

````yaml PUT /groups/{groupId}
openapi: 3.0.3
info:
  title: SecureAI External API
  description: >
    SecureAI External API provides AI chat completion and image generation
    capabilities with knowledge base retrieval, 

    security policies, and comprehensive usage tracking. This API is designed
    for external developers 

    and integrations using API key authentication.


    ## Key Features

    - **RAG (Retrieval-Augmented Generation)**: Automatically search knowledge
    bases for relevant context

    - **Multi-Model Support**: OpenAI, Anthropic, Google, Meta, and other AI
    models

    - **Model Redundancy & Failover**: Caller-defined failover chains (primary +
    fallbacks) with per-attempt timeouts

    - **OpenAI-Compatible Endpoint**: Point any OpenAI SDK at `/api/external/v1`
    — no code changes

    - **Image Generation**: Generate and edit images using Google Gemini 2.5
    Flash Image

    - **Speech-to-Speech (S2S)**: Real-time voice conversations using OpenAI
    Realtime API with WebRTC

    - **Security Policies**: SMLTP policy enforcement, per-call Prompt Shield,
    and signed compliance receipts

    - **Usage Tracking**: Comprehensive usage monitoring, self-service quota,
    and rate limiting

    - **Knowledge Base Integration**: Access to personal and shared knowledge
    bases

    - **User Management**: Complete user, group, and role management
    capabilities

    - **Audit Logging**: Comprehensive activity and security audit logs


    ## Authentication

    All endpoints (except health check) require API key authentication using
    Bearer token:

    ```

    Authorization: Bearer sk-your-api-key-here

    ```


    ## Billing and Usage

    By default, API requests are billed to the user account that owns the API
    key. You can specify 

    a different user to bill by including the `user_id` parameter in your
    request. This allows for:

    - Multi-tenant applications with per-user billing

    - Flexible completion limit management

    - Per-user "Usage by Model" settings


    ## Rate Limits

    - Default: 60 requests per minute, 1000 requests per hour

    - Daily limits: 100 requests (configurable)

    - Monthly limits: 10,000 requests (configurable)


    ## Base URL

    ```

    https://secureai.hiperai.ai/api/external

    ```
  version: 1.1.0
  contact:
    name: SecureAI Support
    email: support@secureai.hiperai.ai
  license:
    name: Proprietary
    url: https://secureai.hiperai.ai/terms
servers:
  - url: https://secureai.hiperai.ai/api/external
    description: Production server
  - url: http://localhost:3010/api/external
    description: Development server
security:
  - ApiKeyAuth: []
tags:
  - name: System
    description: System health and status endpoints
  - name: Discovery
    description: Endpoints to discover available models, indexes, and policies
  - name: Chat
    description: AI chat completion endpoints
  - name: User Management
    description: Endpoints for managing user accounts and roles
  - name: Index Management
    description: Endpoints for managing knowledge base indexes
  - name: Group Management
    description: Endpoints for managing user groups
  - name: SMLTP Security
    description: Endpoints for managing SMLTP security policies and audit logs
  - name: Role Management
    description: Endpoints for managing user roles
  - name: Activity Logs
    description: Endpoints for retrieving activity logs
externalDocs:
  description: SecureAI Documentation
  url: https://secureai.hiperai.ai/docs
paths:
  /groups/{groupId}:
    put:
      tags:
        - Group Management
      summary: Update Group
      description: |
        Update an existing group. Only accessible by administrators.
      parameters:
        - name: groupId
          in: path
          required: true
          description: Group ID to update
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Group name
                  example: Updated Engineering Team
                description:
                  type: string
                  description: Group description
                  example: Updated software engineering team
                users:
                  type: array
                  items:
                    type: string
                  description: Array of user IDs to assign to the group
                  example:
                    - 60a7c8f5e8b4f5001f7a8c24
                    - 60a7c8f5e8b4f5001f7a8c26
                    - 60a7c8f5e8b4f5001f7a8c27
                status:
                  type: string
                  enum:
                    - Active
                    - Inactive
                  description: Group status
                  example: Active
            example:
              name: Updated Engineering Team
              description: Updated software engineering team
              users:
                - 60a7c8f5e8b4f5001f7a8c24
                - 60a7c8f5e8b4f5001f7a8c26
                - 60a7c8f5e8b4f5001f7a8c27
              status: Active
      responses:
        '200':
          description: Group updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Group updated successfully
                  group:
                    type: object
                    properties:
                      id:
                        type: string
                        example: 60a7c8f5e8b4f5001f7a8c25
                      name:
                        type: string
                        example: Updated Engineering Team
                      description:
                        type: string
                        example: Updated software engineering team
                      status:
                        type: string
                        example: Active
                      userCount:
                        type: integer
                        example: 3
                      users:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              example: 60a7c8f5e8b4f5001f7a8c24
                            name:
                              type: string
                              example: John Doe
                            email:
                              type: string
                              example: john@example.com
                      createdAt:
                        type: string
                        format: date-time
                        example: '2024-01-01T00:00:00.000Z'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Access denied - admin only
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Group not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Group name already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Invalid API key
        message:
          type: string
          example: The provided API key is invalid or has been revoked
        request_id:
          type: string
          example: req-abc123
          description: Request ID for tracking (if available)
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: |
        API key authentication using Bearer token format.
        Example: `Authorization: Bearer sk-your-api-key-here`

````