This is the Agents API with native Vercel AI SDK compatibility.
Overview
The migration process involves two main steps:- Export: Retrieve the agent configuration from the source workspace using the Agent Get API
- Import: Create a new agent in the target workspace using the Agent Create API
Prerequisites
Before you begin, ensure you have:Two API keys with AGENT_API scope:- One API key for the source workspace (where the agent currently exists)
- One API key for the target workspace (where you want to migrate the agent)
- Access to the agent: Your source workspace API key must have access to the agent you want to migrate
- Matching resources in target workspace (if applicable):
- If both workspaces have access to the same model, it will be transferred automatically. Otherwise, the model may need to be adjusted manually in the Langdock UI after migration
- If the agent uses custom actions, those integrations must be enabled in the target workspace
- Attachments need to be re-uploaded separately (they are not transferred automatically)
Step 1: Export the Agent from Source Workspace
Use the Agent Get API to retrieve the complete configuration of your agent:Understanding the Response
The Get API returns the complete agent configuration including:name,description,instruction- The agent’s identity and system promptemojiIcon- The emoji icon displayed for the agentmodel- Identifier of the model being used (e.g.,gpt-5-mini-eu)temperature- Creativity setting (0-1)conversationStarters- Suggested prompts for usersinputType- Either “PROMPT” or “STRUCTURED”inputFields- Form field definitions (for STRUCTURED input type)webSearchEnabled,imageGenerationEnabled,codeInterpreterEnabled,canvasEnabled- Capability flagsactions- Custom integration actionsattachments- UUIDs of attached files
Step 2: Transform the Configuration
The Get API response uses slightly different field names than the Create API expects. You need to map the fields:Field Mapping Reference
| Get API Response Field | Create API Request Field |
|---|---|
name | name |
description | description |
emojiIcon | emoji |
instruction | instruction |
model | model |
temperature | creativity |
inputType | inputType |
conversationStarters | conversationStarters |
webSearchEnabled | webSearch |
imageGenerationEnabled | imageGeneration |
codeInterpreterEnabled | dataAnalyst |
canvasEnabled | canvas |
inputFields | inputFields |
actions | actions |
attachments | attachments |
Step 3: Create the Agent in Target Workspace
Use the Agent Create API to create the agent in the target workspace:Complete Migration Script
Here’s a complete script that combines all steps:Handling Special Cases
Actions (Custom Integrations)
Actions reference integrations that must be enabled in the target workspace. Action UUIDs are specific to each workspace’s integration setup.Attachments
Attachment UUIDs reference files stored in the source workspace. These files are not automatically transferred. To migrate attachments:- Download the files from the source workspace
- Re-upload them to the target workspace using the Upload Attachment API
- Update the agent with the new attachment UUIDs
OAuth Connections
Migrating Multiple Agents
To migrate multiple agents, simply loop through a list of agent IDs:Post-Migration Checklist
After migrating an agent, verify the following in the target workspace:- Agent appears in the Agents list with correct name and emoji
- Description and instructions are correctly transferred
- Model is correctly set (or adjust if the target workspace does not support the same model)
- Conversation starters are present
- Capabilities (web search, image generation, etc.) are correctly enabled
- Input fields are properly configured (for STRUCTURED input type)
- Manually configure any OAuth connections through the UI
- Re-upload and attach any necessary files
- Configure custom actions/integrations if needed
- Test the agent by sending a message
Limitations
Keep these limitations in mind when planning your migration:
- Attachments are not transferred - Files must be re-uploaded to the target workspace
- Actions may need reconfiguration - Integration action UUIDs are workspace-specific
- OAuth connections require manual setup - Cannot be configured via API
- Models may require adjustment - The model identifier is transferred, but if the target workspace does not have access to the same model, you may need to adjust it manually in the UI after migration
- Conversation history is not migrated - Only the agent configuration is transferred
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.