---
title: "Create template (Cloud-only)"
method: POST
path: "/v1/templates/{project_id}"
tags: ["templates"]
---

# Create template (Cloud-only)

`POST /v1/templates/{project_id}`

Creates a new template from an existing agent or agent file

## Path parameters

- `project_id` string, required

## Request body

- union — The type of template to create, currently only agent templates are supported
  - object — Create a template from an existing agent
    - `type` 'agent', required
    - `agent_id` string, required — The ID of the agent to use as a template, can be from any project
    - `name` string — Optional custom name for the template. If not provided, a random name will be generated.
  - object — Create a template from an uploaded agent file
    - `type` 'agent_file', required
    - `agent_file` object, required — The agent file to use as a template, this should be a JSON file exported from the platform
    - `name` string — Optional custom name for the template. If not provided, a random name will be generated.
    - `update_existing_tools` boolean — If true, update existing custom tools source_code and json_schema (source_type cannot be changed)

## Response `201`

201

- object
  - `name` string, required — The exact name of the template
  - `id` string, required
  - `project_id` string, required
  - `project_slug` string, required
  - `latest_version` string, required — The latest version of the template
  - `description` string
  - `template_deployment_slug` string, required — The full name of the template, including version and project slug
  - `updated_at` string, required — When the template was last updated

## Other responses

- `400` — 400

## Changes

- **2025-09-29** `bd57af9e9fa9` — 1 info
  - added the new optional request property `oneOf[subschema #2]/update_existing_tools`

[Change history](https://skmtc.dev/yu-code666/apis/letta-api/changes/v1/templates/:project_id/post.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)
