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

> Aktualisiere einen bestehenden Prompt

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

## Basis-URL

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

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

## Erforderliche Scopes

Dieser Endpoint erfordert den `PROMPT_API` Scope.

> [!NOTE]
>
> Erfordert Zugriff als Ersteller, Workspace-Editor oder Gruppen-Editor des Prompt-Ordners.

## Parameter

### Pfad-Parameter

| Parameter | Typ | Erforderlich | Beschreibung |
| - | - | - | - |
| `promptId` | string | Ja | UUID des zu aktualisierenden Prompts. |

### Request Body

| Parameter | Typ | Beschreibung |
| - | - | - |
| `title` | string | Prompt-Titel. Minimum: 2 Zeichen. Maximum: 100 Zeichen. |
| `prompt` | string | Prompt-Inhalt. Minimum: 2 Zeichen. Maximum: 120000 Zeichen. |
| `promptFolderId` | string \| null | Ordner-UUID zum Zuweisen oder `null`, um den Ordner zu entfernen. Darf nicht gesetzt sein, solange der Prompt mit dem Workspace geteilt ist. |
| `sharedWithWorkspace` | boolean | Teilt den Prompt mit dem Workspace. Erfordert `sharePrompts`. Darf nicht `true` sein, solange der Prompt in einem Ordner liegt. |

## Beispiel

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

async function updatePrompt(promptId) {
  const response = await axios.patch(
    `https://api.langdock.com/prompts/v1/${promptId}`,
    {
      title: "Support Reply",
      prompt: "Write a concise customer reply. Include the next best action and the ticket ID."
    },
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
      }
    }
  );

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

updatePrompt("550e8400-e29b-41d4-a716-446655440000");
```

## Antwortformat

### Erfolgsantwort (200 OK)

```typescript theme={null}
{
  prompt: {
    id: string;
    title: string;
    prompt: string;
    createdBy: string | null;
    promptFolderId: string | null;
    sharedWithWorkspace: boolean;
    createdAt: string | null;
    updatedAt: string | null;
  };
}
```

## Fehlerbehandlung

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

> [!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](https://docs.langdock.com/de/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices.md).


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