Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

Update current template from agent file (Cloud-only)

client.templates.update(stringtemplateName, TemplateUpdateParams { agent_file_json, save_existing_changes, update_existing_tools } body, RequestOptionsoptions?): TemplateUpdateResponse { success, message }
patch/v1/templates/{template_name}

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

ParametersExpand Collapse
templateName: string
body: TemplateUpdateParams { agent_file_json, save_existing_changes, update_existing_tools }
agent_file_json: Record<string, unknown>

The agent file to update the current template version from

save_existing_changes?: boolean

If true, Letta will automatically save any changes as a version before updating the template

update_existing_tools?: boolean

If true, update existing custom tools source_code and json_schema (source_type cannot be changed)

ReturnsExpand Collapse
TemplateUpdateResponse { success, message }
success: boolean
message?: string
Update current template from agent file (Cloud-only)
import Letta from '@letta-ai/letta-client';

const client = new Letta({
  apiKey: 'My API Key',
});

const template = await client.templates.update('template_name', { agent_file_json: { foo: 'bar' } });

console.log(template.success);
{
  "success": true,
  "message": "message"
}
Returns Examples
{
  "success": true,
  "message": "message"
}