Skip to main content
GET
/
agent
/
v1
/
get
Retrieves details of an existing agent
curl --request GET \
  --url https://api.langdock.com/agent/v1/get \
  --header 'Authorization: Bearer <token>'
{
  "status": "<string>",
  "agent": {
    "name": "<string>",
    "instructions": "<string>",
    "description": "<string>",
    "temperature": 0.5,
    "model": "<string>",
    "capabilities": {
      "webSearch": true,
      "dataAnalyst": true,
      "imageGeneration": true
    },
    "actions": [
      "<unknown>"
    ],
    "vectorDb": [
      "<unknown>"
    ],
    "knowledgeFolderIds": [
      "<string>"
    ],
    "attachmentIds": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ]
  }
}
⚠️ Using our API via a dedicated deployment? Just replace api.langdock.com with your deployment’s base URL: <deployment-url>/api/public
This is the new Agents API with native Vercel AI SDK compatibility. If you’re using the legacy Assistants API, see the migration guide.
Retrieves the complete configuration and details of an existing agent in your workspace.
Requires an API key with the AGENT_API scope and access to the agent you want to retrieve.

Query Parameters

ParameterTypeRequiredDescription
agentIdstringYesUUID of the agent to retrieve

Examples

Basic Retrieval

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);
}

Validation Rules

The API enforces the following validation rules:
  • Agent access - Your API key must have access to the agent
  • Workspace match - Agent must belong to the same workspace as your API key

Response Format

Success Response (200 OK)

{
  status: "success";
  agent: {
    id: string;
    name: string;
    description: string;
    instruction: string;
    emojiIcon: string;
    model: string;
    temperature: number;
    conversationStarters: string[];
    inputType: "PROMPT" | "STRUCTURED";
    webSearchEnabled: boolean;
    imageGenerationEnabled: boolean;
    codeInterpreterEnabled: boolean;
    canvasEnabled: boolean;
    actions: Array<{
      actionId: string;
      requiresConfirmation: boolean;
    }>;
    inputFields: Array<{
      slug: string;
      type: string;
      label: string;
      description: string;
      required: boolean;
      order: number;
      options: string[];
      fileTypes: string[] | null;
    }>;
    attachments: string[];
    createdAt: string;
    updatedAt: string;
  };
}

Error Handling

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('Invalid agent ID format');
        break;
      case 401:
        console.error('Invalid or missing API key');
        break;
      case 403:
        console.error('Insufficient permissions - no access to this agent');
        break;
      case 404:
        console.error('Agent not found');
        break;
      case 500:
        console.error('Server error');
        break;
    }
  }
}
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.

Authorizations

Authorization
string
header
required

API key as Bearer token. Format "Bearer YOUR_API_KEY"

Query Parameters

agentId
string<uuid>
required

Response

200 - application/json

Agent retrieved successfully

status
string
agent
object