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

# Agent Get API

> Details eines vorhandenen Agenten abrufen

Ruft die verfügbaren aktuellen Einstellungen und Details eines vorhandenen Agenten in deinem Workspace ab. Der Endpoint gibt die aktive (veröffentlichte) Version des Agenten zurück. Wenn der Agent noch nie veröffentlicht wurde, wird stattdessen der aktuelle Entwurf zurückgegeben.

## Bevor du startest

* **API-Key-Scope**: Erfordert einen API-Schlüssel mit dem **Agenten API**-Scope und Zugriff auf den Agenten, den du abrufen möchtest.
* **Veraltete Assistants API**: Dies ist die neue Agents API mit nativer Vercel AI SDK Kompatibilität. Wenn du die veraltete Assistants API verwendest, siehe den [Migrations-Guide](/de/developer/agents-api/assistant-to-agent-migration).

## Basis-URL

```
https://api.langdock.com/agent/v1/get
```

<Warning>
  **Dedicated Deployments**

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

## Parameter

| Parameter | Typ | Erforderlich | Beschreibung |
| - | - | - | - |
| `agentId` | string | Ja | UUID des abzurufenden Agenten |

## Beispiele

### Einfacher Abruf

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

async function getAgent() {
  const response = await axios.get(
    "https://api.langdock.com/agent/v1/get",
    {
      params: {
        agentId: "550e8400-e29b-41d4-a716-446655440000"
      },
      headers: {
        Authorization: "Bearer YOUR_API_KEY"
      }
    }
  );

  console.log("Agent-Details:", response.data.agent);
}
```

## Validierungsregeln

Die API wendet folgende Validierungsregeln an:

* **Agent-Zugriff** - Dein API-Schlüssel muss Zugriff auf den Agenten haben
* **Workspace-Übereinstimmung** - Der Agent muss zum selben Workspace wie dein API-Schlüssel gehören

## Antwortformat

### Erfolgreiche Antwort (200 OK)

```typescript theme={null}
{
  status: "success";
  agent: {
    id: string;
    name: string;
    description: string | null;
    instruction: string | null;
    emojiIcon: string | null;
    model: string | null;
    temperature: number;
    conversationStarters: string[];
    inputType: "PROMPT" | "STRUCTURED" | "INTEGRATION" | "SCHEDULED" | "WEBHOOK";
    webSearchEnabled: boolean;
    imageGenerationEnabled: boolean;
    canvasEnabled: boolean;
    extendedThinking: boolean;
    actions: Array<{
      actionId: string;
      requiresConfirmation: boolean;
    }>;
    inputFields: Array<{
      type: "TEXT" | "MULTI_LINE_TEXT" | "NUMBER" | "CHECKBOX" | "FILE" | "SELECT" | "MULTI_SELECT" | "DATE" | "EMAIL";
      label: string;
      description: string | null;
      required: boolean;
      order: number;
    }>;
    attachments: string[];
    knowledgeFolderIds: string[];
    skillIds: string[];
    owner: {
      id: string;
      name: string | null;
      email: string;
    } | null;
    createdAt: string;
    updatedAt: string;
  };
}
```

Das `actions` Array lässt IDs weg, deren Action fehlt oder gelöscht ist. Live-Actions, die in deinem Workspace nicht verfügbar sind, bleiben in der Liste.

`skillIds` listet angehängte Skills. Dateivorlagen bleiben am Agenten und erscheinen in diesem Array nicht.

## Fehlerbehandlung

```typescript theme={null}
try {
  const response = await axios.get('https://api.langdock.com/agent/v1/get', ...);
} catch (error) {
  if (error.response) {
    switch (error.response.status) {
      case 400:
        console.error('Ungültiges Agent-ID-Format');
        break;
      case 401:
        console.error('Ungültiger oder fehlender API-Schlüssel');
        break;
      case 403:
        console.error('Unzureichende Berechtigungen - kein Zugriff auf diesen Agenten');
        break;
      case 404:
        console.error('Agent nicht gefunden');
        break;
      case 500:
        console.error('Server-Fehler');
        break;
    }
  }
}
```

<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 GET /agent/v1/get
openapi: 3.0.0
info:
  title: Langdock API
  version: 3.0.0
servers:
  - url: https://api.langdock.com
    description: Production
security:
  - bearerAuth: []
paths:
  /agent/v1/get:
    get:
      tags:
        - Agent Build
      summary: Retrieves details of an existing agent
      description: >-
        Retrieves the current settings and details available for an existing
        agent. Returns the published version when one exists, otherwise the
        draft. The `actions` array omits missing and soft-deleted action ids and
        still includes live actions that are unavailable in the workspace.
      operationId: getAgentV2
      parameters:
        - name: agentId
          in: query
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Agent retrieved successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - agent
                properties:
                  status:
                    type: string
                  agent:
                    $ref: '#/components/schemas/AssistantDetails'
components:
  schemas:
    AssistantDetails:
      type: object
      required:
        - id
        - name
        - description
        - instruction
        - emojiIcon
        - model
        - temperature
        - conversationStarters
        - inputType
        - webSearchEnabled
        - imageGenerationEnabled
        - canvasEnabled
        - extendedThinking
        - actions
        - inputFields
        - attachments
        - knowledgeFolderIds
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the agent
        name:
          type: string
          description: Name of the agent
        description:
          type: string
          nullable: true
          description: Description of what the agent does
        instruction:
          type: string
          nullable: true
          description: System prompt/instructions for the agent
        emojiIcon:
          type: string
          nullable: true
          description: Emoji icon for the agent
        model:
          type: string
          nullable: true
          description: Model ID to use (see Models for Agent API)
        temperature:
          type: number
          minimum: 0
          maximum: 1
          description: Temperature/creativity setting for response generation
        conversationStarters:
          type: array
          items:
            type: string
          description: Array of suggested prompts to help users get started
        inputType:
          type: string
          enum:
            - PROMPT
            - STRUCTURED
            - INTEGRATION
            - SCHEDULED
            - WEBHOOK
          description: Input type for the agent
        webSearchEnabled:
          type: boolean
          description: Whether web search capability is enabled
        imageGenerationEnabled:
          type: boolean
          description: Whether image generation capability is enabled
        canvasEnabled:
          type: boolean
          description: Whether canvas capability is enabled
        extendedThinking:
          type: boolean
          description: >-
            Whether extended thinking is enabled. Only supported on models that
            expose this capability; enabling it on an unsupported model returns
            a 400 error.
        actions:
          type: array
          items:
            type: object
            required:
              - actionId
              - requiresConfirmation
            properties:
              actionId:
                type: string
                format: uuid
                description: >-
                  UUID of a live action. Missing and soft-deleted ids are
                  omitted. Live unavailable actions remain.
              requiresConfirmation:
                type: boolean
                description: Whether user confirmation is required before executing
          description: >-
            Live actions on the returned version. Missing and soft-deleted ids
            are omitted. Live unavailable actions remain.
        inputFields:
          type: array
          items:
            type: object
            required:
              - type
              - label
              - description
              - required
              - order
            properties:
              type:
                type: string
                enum:
                  - TEXT
                  - MULTI_LINE_TEXT
                  - NUMBER
                  - CHECKBOX
                  - FILE
                  - SELECT
                  - MULTI_SELECT
                  - DATE
                  - EMAIL
                description: Field type
              label:
                type: string
                description: Display label for the field
              description:
                type: string
                nullable: true
                description: Help text for the field
              required:
                type: boolean
                description: Whether the field is required
              order:
                type: integer
                minimum: 0
                description: Display order (0-indexed)
          description: Array of form field definitions (for STRUCTURED input type)
        attachments:
          type: array
          items:
            type: string
            format: uuid
          description: Array of attachment UUIDs associated with the agent
        knowledgeFolderIds:
          type: array
          items:
            type: string
            format: uuid
          description: Array of Folder UUIDs associated with the agent
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the agent was created
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the agent was last updated
  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.