Skip to main content
POST
/
agents
/
import-template
Import Agent Template
curl --request POST \
  --url https://eu-gcp-api.vg-stuff.com/v3/agents/import-template \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agentTemplate": {
    "workspaceId": "<string>",
    "name": "<string>",
    "description": "<string>",
    "nodes": "<array>",
    "tools": "<array>",
    "variables": "<array>",
    "agentData": "<unknown>"
  },
  "agentName": "<string>",
  "fromAgentId": "<string>"
}
'
{
  "message": "Agent ID is required",
  "code": "BAD_REQUEST"
}

Import from Template

{
  "agentTemplate": {
    "name": "My Template",
    "agentData": {...},
    "tools": [...],
    "variables": [...],
    "nodes": [...]
  },
  "agentName": "My New Agent"
}

Convert Existing Agent to Node-Based

Use fromAgentId to convert a legacy agent to the node-based architecture:
{
  "fromAgentId": "existing_agent_id",
  "agentName": "My Converted Agent"
}
This will:
  • Create a new node-based agent
  • Migrate vg_systemPrompt and vg_initPrompt to the start node’s instructions
  • Copy all tools and variables with new IDs
  • Migrate knowledge base documents

Example Response

{
  "agentCreated": {
    "ID": "new_agent_id",
    "title": "My New Agent",
    "nodes": [...],
    "SECRET_API_KEY": "vg_xxxx"
  }
}

Notes

  • New unique IDs are generated for the agent, tools, and variables
  • Tool and variable references in instructions are automatically updated
  • Agent limits are enforced based on your plan

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
agentTemplate
object
agentName
string
fromAgentId
string

Response

Successful response