---
title: "Migrate Agent"
method: POST
path: "/v1/agents/{agent_id}/migrate"
tags: ["agents"]
---

# Migrate Agent

`POST /v1/agents/{agent_id}/migrate`

Migrate an agent to a new versioned agent template. This will only work for "classic" and non-multiagent agent templates.

## Path parameters

- `agent_id` string, required

## Request body

- object
  - `to_template` string, required
  - `preserve_core_memories` boolean, required
  - `preserve_tool_variables` boolean — If true, preserves the existing agent's tool environment variables instead of using the template's variables

## Response `200`

200

- object
  - `success` true, required

---

[API](https://skmtc.net/yu-code666/apis/letta-api.md) · [All operations](https://skmtc.net/yu-code666/apis/letta-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/yu-code666/letta-api/versions/6cec99480c13/schema)
