---
title: "Update current template from agent file (Cloud-only)"
method: PUT
path: "/v1/templates/{project_id}/{template_name}/agent-file"
tags: ["templates"]
---

# Update current template from agent file (Cloud-only)

`PUT /v1/templates/{project_id}/{template_name}/agent-file`

Updates the current working version of a template from an agent file

## Path parameters

- `project_id` string, required
- `template_name` string, required

## Request body

- object
  - `agent_file_json` object, required — The agent file to update the current template version from
  - `update_existing_tools` boolean — If true, update existing custom tools source_code and json_schema (source_type cannot be changed)
  - `save_existing_changes` boolean — If true, Letta will automatically save any changes as a version before updating the template

## Response `200`

200

- object
  - `success` boolean, required
  - `message` string

## Other responses

- `400` — 400
- `404` — 404
- `500` — 500

## Changes

- **2025-09-29** `bd57af9e9fa9` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/yu-code666/apis/letta-api/changes/v1/templates/:project_id/:template_name/agent-file/put.md)

---

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