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

> Rufe einen Prompt anhand der ID aus deinem Workspace ab

Ruft einen Prompt anhand der ID aus deinem Workspace ab.

## 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 über Besitz, Workspace-Freigabe oder einen geteilten Ordner.

## Parameter

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

## Beispiel

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

async function getPrompt(promptId) {
  const response = await axios.get(
    `https://api.langdock.com/prompts/v1/${promptId}`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY"
      }
    }
  );

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

getPrompt("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ültiges Prompt-ID-Format |
| 401 | Ungültiger oder fehlender API Key |
| 403 | Fehlender `PROMPT_API` Scope oder kein Workspace-Zugriff |
| 404 | Prompt nicht gefunden oder nicht zugänglich |
| 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.