> ## Documentation Index
> Fetch the complete documentation index at: https://docs.convocore.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Import Agent Template

> Imports an agent template, this route must use the new V3 [endpoints](/api-reference/v3/intro).

## Import from Template

```json theme={null}
{
  "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:

```json theme={null}
{
  "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

```json theme={null}
{
  "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


## OpenAPI

````yaml POST /agents/import-template
openapi: 3.0.3
info:
  title: Convocore OpenAPI
  description: Full API reference for Convocore
  version: 1.0.4
servers:
  - url: https://eu-gcp-api.vg-stuff.com/v3
    description: EU Node.js API server
  - url: https://na-gcp-api.vg-stuff.com/v3
    description: NA Node.js API server
security: []
paths:
  /agents/import-template:
    post:
      summary: Import Agent Template
      operationId: convertAgentTemplateToAgent
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                agentTemplate:
                  type: object
                  properties:
                    name:
                      type: string
                    description:
                      type: string
                    nodes:
                      type: array
                    tools:
                      type: array
                    variables:
                      type: array
                    agentData: {}
                    workspaceId:
                      type: string
                  required:
                    - workspaceId
                  additionalProperties: {}
                agentName:
                  type: string
                fromAgentId:
                  type: string
              additionalProperties: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema: {}
        default:
          $ref: '#/components/responses/error'
      security:
        - Authorization: []
components:
  responses:
    error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              code:
                type: string
              issues:
                type: array
                items:
                  type: object
                  properties:
                    message:
                      type: string
                  required:
                    - message
                  additionalProperties: false
            required:
              - message
              - code
            additionalProperties: false
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````