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

# Prompt-Ordner aktualisieren

> Aktualisiere einen bestehenden Prompt-Ordner

Aktualisiert einen bestehenden Prompt-Ordner in deinem Workspace. Gib nur die Felder an, die du ändern möchtest.

## Basis-URL

```
https://api.langdock.com/prompts/v1/folders/{folderId}
```

<Warning>
  **Dedicated Deployments**

  Ersetze `api.langdock.com` durch `<your-deployment-url>/api/public` in allen Anfragen.
</Warning>

## Erforderliche Scopes

Dieser Endpoint erfordert den `PROMPT_API` Scope.

<Info>
  Private Ordner erfordern Zugriff als Ersteller. Workspace-geteilte Ordner erfordern Workspace-Editor-Zugriff oder `sharePrompts`. Gruppen-geteilte Ordner erfordern Gruppen-Editor-Zugriff oder Workspace-Editor-Zugriff.
</Info>

## Parameter

### Pfad-Parameter

| Parameter  | Typ    | Erforderlich | Beschreibung                          |
| ---------- | ------ | ------------ | ------------------------------------- |
| `folderId` | string | Ja           | UUID des zu aktualisierenden Ordners. |

### Request Body

| Parameter             | Typ            | Beschreibung                                                                                                                              |
| --------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `name`                | string         | Ordnername. Minimum: 2 Zeichen. Maximum: 50 Zeichen.                                                                                      |
| `sharedWithWorkspace` | boolean        | Teilt den Ordner mit dem Workspace. Darf nicht `true` sein, solange der Ordner mit einer Gruppe geteilt ist.                              |
| `sharedWithGroupId`   | string \| null | Gruppen-UUID zum Teilen oder `null`, um die Gruppe zu trennen. Darf nicht gesetzt sein, solange der Ordner mit dem Workspace geteilt ist. |

## Beispiel

```javascript theme={null}
const axios = require("axios");

async function updatePromptFolder(folderId) {
  const response = await axios.patch(
    `https://api.langdock.com/prompts/v1/folders/${folderId}`,
    {
      name: "Support templates"
    },
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
      }
    }
  );

  console.log("Updated folder:", response.data.folder.updatedAt);
}

updatePromptFolder("7c9e6679-7425-40de-944b-e07fc1f90ae7");
```

## Antwortformat

### Erfolgsantwort (200 OK)

```typescript theme={null}
{
  folder: {
    id: string;
    name: string;
    createdBy: string;
    sharedWithWorkspace: boolean;
    sharedWithGroupId: string | null;
    createdAt: string;
    updatedAt: string;
  };
}
```

## Fehlerbehandlung

| Statuscode | Beschreibung                                                                                            |
| ---------- | ------------------------------------------------------------------------------------------------------- |
| 400        | Ungültiger Request Body, fehlende Update-Felder oder Workspace-Freigabe kombiniert mit Gruppen-Freigabe |
| 401        | Ungültiger oder fehlender API Key                                                                       |
| 403        | Fehlender `PROMPT_API` Scope oder kein Verwaltungszugriff                                               |
| 404        | Prompt-Ordner oder Gruppe nicht gefunden                                                                |
| 429        | Rate Limit überschritten                                                                                |
| 500        | Interner Serverfehler                                                                                   |

<Info>
  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).
</Info>


## OpenAPI

````yaml PATCH /prompts/v1/folders/{folderId}
openapi: 3.0.0
info:
  title: Langdock API
  version: 3.0.0
servers:
  - url: https://api.langdock.com
    description: Production
security:
  - bearerAuth: []
paths:
  /prompts/v1/folders/{folderId}:
    patch:
      tags:
        - Prompts
      summary: Update a prompt folder
      description: Updates an existing prompt folder in your workspace.
      operationId: updatePromptFolder
      parameters:
        - $ref: '#/components/parameters/PromptFolderId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePromptFolderRequest'
      responses:
        '200':
          description: Prompt folder updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptFolderResponse'
        '400':
          description: Invalid request body
        '401':
          description: Invalid or missing API key
        '403':
          description: Missing required scope or manage access
        '404':
          description: Prompt folder or group not found
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal server error
components:
  parameters:
    PromptFolderId:
      name: folderId
      in: path
      required: true
      description: UUID of the prompt folder.
      schema:
        type: string
        format: uuid
  schemas:
    UpdatePromptFolderRequest:
      type: object
      minProperties: 1
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 2
          maxLength: 50
          description: Folder name.
        sharedWithWorkspace:
          type: boolean
          description: Share the folder with the workspace.
        sharedWithGroupId:
          type: string
          format: uuid
          nullable: true
          description: Group UUID to share with, or null to disconnect the group.
    PromptFolderResponse:
      type: object
      required:
        - folder
      properties:
        folder:
          $ref: '#/components/schemas/PromptFolder'
    PromptFolder:
      type: object
      required:
        - id
        - name
        - createdBy
        - sharedWithWorkspace
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the prompt folder.
        name:
          type: string
          minLength: 2
          maxLength: 50
          description: Folder name.
        createdBy:
          type: string
          format: uuid
          description: User ID of the folder creator.
        sharedWithWorkspace:
          type: boolean
          description: Whether the folder is shared with the workspace.
        sharedWithGroupId:
          type: string
          format: uuid
          nullable: true
          description: Group ID the folder is shared with.
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp for folder creation.
        updatedAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp for the latest folder update.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key as Bearer token. Format "Bearer YOUR_API_KEY"

````