openapi: 3.1.0 info: title: Letta Admin Templates API version: 1.0.0 description: REST API for Letta, the stateful agents platform. Manage agents, memory blocks, archival passages, sources, custom tools, MCP servers, multi-agent groups, runs, and streaming responses. Available as Letta Cloud (managed) at https://api.letta.com/v1 and as the self-hosted open-source server (Apache-2.0) typically run at http://localhost:8283. contact: name: Letta url: https://www.letta.com/ email: support@letta.com license: name: Apache-2.0 url: https://github.com/letta-ai/letta/blob/main/LICENSE x-logo: url: https://www.letta.com/favicon.ico servers: - url: https://api.letta.com description: Letta Cloud (managed) - url: https://app.letta.com description: Letta Cloud (app) - url: http://localhost:8283 description: Self-hosted Letta server security: - bearerAuth: [] tags: - name: Templates description: Reusable agent templates for instantiation. paths: /v1/templates/{project_id}/{template_version}/agents: post: description: Creates an Agent or multiple Agents from a template summary: Create Agents from Template tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: template_version in: path required: true schema: type: string description: The template version, formatted as {template-name}:{version-number} or {template-name}:latest. This endpoint is not available for self-hosted Letta. operationId: templates.createAgentsFromTemplate requestBody: description: Body content: application/json: schema: type: object properties: tags: type: array items: type: string pattern: ^[a-zA-Z0-9-_ ]*$ description: The tags to assign to the agent agent_name: type: string pattern: ^[a-zA-Z0-9-_ ]*$ description: The name of the agent, optional otherwise a random one will be assigned initial_message_sequence: type: array items: type: object properties: role: type: string enum: - user - system - assistant content: type: string name: type: string nullable: true otid: type: string nullable: true sender_id: type: string nullable: true batch_item_id: type: string nullable: true group_id: type: string nullable: true required: - role - content description: Set an initial sequence of messages, if not provided, the agent will start with the default message sequence, if an empty array is provided, the agent will start with no messages memory_variables: type: object additionalProperties: type: string description: The memory variables to assign to the agent tool_variables: type: object additionalProperties: type: string description: The tool variables to assign to the agent identity_ids: type: array items: type: string description: The identity ids to assign to the agent responses: '201': description: '201' '402': description: '402' content: application/json: schema: type: object properties: message: type: string limit: type: number required: - message - limit /v1/templates/{template_version}/agents: post: description: Creates an Agent or multiple Agents from a template summary: Create Agents from Template tags: - Templates parameters: - name: template_version in: path required: true schema: type: string description: The template version, formatted as {template-name}:{version-number} or {template-name}:latest. This endpoint is not available for self-hosted Letta. operationId: templates.createAgentsFromTemplateNoProject requestBody: description: Body content: application/json: schema: type: object properties: tags: type: array items: type: string pattern: ^[a-zA-Z0-9-_ ]*$ description: The tags to assign to the agent agent_name: type: string pattern: ^[a-zA-Z0-9-_ ]*$ description: The name of the agent, optional otherwise a random one will be assigned initial_message_sequence: type: array items: type: object properties: role: type: string enum: - user - system - assistant content: type: string name: type: string nullable: true otid: type: string nullable: true sender_id: type: string nullable: true batch_item_id: type: string nullable: true group_id: type: string nullable: true required: - role - content description: Set an initial sequence of messages, if not provided, the agent will start with the default message sequence, if an empty array is provided, the agent will start with no messages memory_variables: type: object additionalProperties: type: string description: The memory variables to assign to the agent tool_variables: type: object additionalProperties: type: string description: The tool variables to assign to the agent identity_ids: type: array items: type: string description: The identity ids to assign to the agent responses: '201': description: '201' content: application/json: schema: type: object properties: agent_ids: type: array items: type: string description: Array of created agent IDs group_id: type: string nullable: true description: Optional group ID if agents were created in a group deployment_id: type: string description: The deployment ID for the created agents required: - agent_ids - group_id - deployment_id description: Response containing created agent IDs and associated metadata '402': description: '402' content: application/json: schema: type: object properties: message: type: string limit: type: number required: - message - limit /v1/templates: get: description: List all templates summary: List Templates (Cloud-only) tags: - Templates parameters: - name: offset in: query schema: oneOf: - type: string - type: number - name: exact in: query description: Whether to search for an exact name match schema: type: string - name: limit in: query schema: type: string - name: version in: query description: Specify the version you want to return, otherwise will return the latest version schema: type: string - name: template_id in: query schema: type: string - name: name in: query schema: type: string - name: search in: query schema: type: string - name: project_slug in: query schema: type: string - name: project_id in: query schema: type: string - name: sort_by in: query schema: type: string enum: - updated_at - created_at operationId: templates.listTemplates responses: '200': description: '200' content: application/json: schema: type: object properties: templates: type: array items: type: object properties: name: type: string description: The exact name of the template id: type: string project_id: type: string project_slug: type: string latest_version: type: string description: The latest version of the template description: type: string template_deployment_slug: type: string description: The full name of the template, including version and project slug updated_at: type: string description: When the template was last updated required: - name - id - project_id - project_slug - latest_version - template_deployment_slug - updated_at has_next_page: type: boolean required: - templates - has_next_page post: description: Creates a new template from an existing agent or agent file summary: Create Template (Cloud-only) tags: - Templates parameters: [] operationId: templates.createTemplateNoProject requestBody: description: Body content: application/json: schema: discriminator: propertyName: type oneOf: - type: object properties: type: type: string enum: - agent agent_id: type: string description: The ID of the agent to use as a template, can be from any project name: type: string pattern: ^[a-zA-Z0-9_-]+$ description: Optional custom name for the template. If not provided, a random name will be generated. required: - type - agent_id summary: From Agent description: Create a template from an existing agent - type: object properties: type: type: string enum: - agent_file agent_file: type: object additionalProperties: nullable: true description: The agent file to use as a template, this should be a JSON file exported from the platform name: type: string pattern: ^[a-zA-Z0-9_-]+$ description: Optional custom name for the template. If not provided, a random name will be generated. update_existing_tools: type: boolean description: If true, update existing custom tools source_code and json_schema (source_type cannot be changed) required: - type - agent_file summary: From Agent File description: Create a template from an uploaded agent file summary: Create template description: The type of template to create, currently only agent templates are supported responses: '201': description: '201' content: application/json: schema: type: object properties: name: type: string description: The exact name of the template id: type: string project_id: type: string project_slug: type: string latest_version: type: string description: The latest version of the template description: type: string template_deployment_slug: type: string description: The full name of the template, including version and project slug updated_at: type: string description: When the template was last updated required: - name - id - project_id - project_slug - latest_version - template_deployment_slug - updated_at '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{template_name}/save: post: description: Saves the current version of the template as a new version summary: Save Template Version (Cloud-only) tags: - Templates parameters: - name: template_name in: path required: true schema: type: string description: The template version, formatted as {template-name}, any version appended will be ignored operationId: templates.saveTemplateVersionNoProject requestBody: description: Body content: application/json: schema: type: object properties: preserve_environment_variables_on_migration: type: boolean description: If true, the environment variables will be preserved in the template version when migrating agents preserve_core_memories_on_migration: type: boolean description: If true, the core memories will be preserved in the template version when migrating agents preserve_sources_on_migration: type: boolean description: If true, existing agent folders/sources will be preserved and merged with template sources during migration. If false, agent sources will be replaced with template sources. block_reconciliation_strategy: type: string enum: - reconcile-all - preserve-deleted description: 'Strategy for reconciling memory blocks during migration: "reconcile-all" deletes blocks not in the template, "preserve-deleted" keeps them. Defaults to "preserve-deleted".' migrate_agents: type: boolean description: If true, existing agents attached to this template will be migrated to the new template version message: type: string description: A message to describe the changes made in this template version responses: '200': description: '200' content: application/json: schema: type: object properties: name: type: string description: The exact name of the template id: type: string project_id: type: string project_slug: type: string latest_version: type: string description: The latest version of the template description: type: string template_deployment_slug: type: string description: The full name of the template, including version and project slug updated_at: type: string description: When the template was last updated required: - name - id - project_id - project_slug - latest_version - template_deployment_slug - updated_at '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{project_id}/{template_name}: post: description: Saves the current version of the template as a new version summary: Save Template Version (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: template_name in: path required: true schema: type: string description: The template version, formatted as {template-name}, any version appended will be ignored operationId: templates.saveTemplateVersion requestBody: description: Body content: application/json: schema: type: object properties: preserve_environment_variables_on_migration: type: boolean description: If true, the environment variables will be preserved in the template version when migrating agents preserve_core_memories_on_migration: type: boolean description: If true, the core memories will be preserved in the template version when migrating agents preserve_sources_on_migration: type: boolean description: If true, existing agent folders/sources will be preserved and merged with template sources during migration. If false, agent sources will be replaced with template sources. block_reconciliation_strategy: type: string enum: - reconcile-all - preserve-deleted description: 'Strategy for reconciling memory blocks during migration: "reconcile-all" deletes blocks not in the template, "preserve-deleted" keeps them. Defaults to "preserve-deleted".' migrate_agents: type: boolean description: If true, existing agents attached to this template will be migrated to the new template version message: type: string description: A message to describe the changes made in this template version responses: '200': description: '200' content: application/json: schema: type: object properties: name: type: string description: The exact name of the template id: type: string project_id: type: string project_slug: type: string latest_version: type: string description: The latest version of the template description: type: string template_deployment_slug: type: string description: The full name of the template, including version and project slug updated_at: type: string description: When the template was last updated required: - name - id - project_id - project_slug - latest_version - template_deployment_slug - updated_at '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message delete: description: Deletes all versions of a template with the specified name summary: Delete Template (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: template_name in: path required: true schema: type: string description: The template name (without version) operationId: templates.deleteTemplate requestBody: description: Body content: application/json: schema: type: object properties: {} responses: '200': description: '200' content: application/json: schema: type: object properties: success: type: boolean required: - success '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{project_id}/{template_version}/snapshot: get: description: Get a snapshot of the template version, this will return the template state at a specific version summary: Get Template Snapshot (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: template_version in: path required: true schema: type: string description: The template version, formatted as {template-name}:{version-number} or {template-name}:latest operationId: templates.getTemplateSnapshot responses: '200': description: '200' content: application/json: schema: type: object properties: agents: type: array items: type: object properties: model: type: string systemPrompt: type: string toolIds: type: array items: type: string nullable: true sourceIds: type: array items: type: string nullable: true memoryVariables: type: object properties: version: type: string data: type: array items: type: object properties: key: type: string defaultValue: type: string nullable: true type: type: string required: - key - type required: - version - data nullable: true toolVariables: type: object properties: version: type: string data: type: array items: type: object properties: key: type: string defaultValue: type: string nullable: true type: type: string required: - key - type required: - version - data nullable: true tags: type: array items: type: string nullable: true identityIds: type: array items: type: string nullable: true toolRules: type: array items: oneOf: - type: object properties: tool_name: type: string type: type: string enum: - constrain_child_tools prompt_template: type: string nullable: true children: type: array items: type: string child_arg_nodes: type: array items: type: object properties: name: type: string args: type: object additionalProperties: {} nullable: true required: - name nullable: true required: - tool_name - children - type: object properties: tool_name: type: string type: type: string enum: - run_first prompt_template: type: string nullable: true args: type: object additionalProperties: {} nullable: true required: - tool_name - type: object properties: tool_name: type: string type: type: string enum: - exit_loop prompt_template: type: string nullable: true required: - tool_name - type: object properties: tool_name: type: string type: type: string enum: - conditional prompt_template: type: string nullable: true default_child: type: string nullable: true child_output_mapping: type: object additionalProperties: type: string require_output_mapping: type: boolean required: - tool_name - child_output_mapping - type: object properties: tool_name: type: string type: type: string enum: - continue_loop prompt_template: type: string nullable: true required: - tool_name - type: object properties: tool_name: type: string type: type: string enum: - required_before_exit prompt_template: type: string nullable: true required: - tool_name - type: object properties: tool_name: type: string type: type: string enum: - max_count_per_step prompt_template: type: string nullable: true max_count_limit: type: number required: - tool_name - max_count_limit - type: object properties: tool_name: type: string type: type: string enum: - parent_last_tool prompt_template: type: string nullable: true children: type: array items: type: string required: - tool_name - children - type: object properties: tool_name: type: string type: type: string enum: - requires_approval prompt_template: type: string nullable: true required: - tool_name nullable: true agentType: type: string enum: - letta_v1_agent - memgpt_agent - memgpt_v2_agent - react_agent - workflow_agent - split_thread_agent - sleeptime_agent - voice_convo_agent - voice_sleeptime_agent properties: type: object properties: enable_reasoner: type: boolean nullable: true put_inner_thoughts_in_kwargs: type: boolean nullable: true context_window_limit: type: number nullable: true max_tokens: type: number nullable: true max_reasoning_tokens: type: number nullable: true max_files_open: type: number nullable: true message_buffer_autoclear: type: boolean nullable: true verbosity_level: type: string enum: - low - medium - high nullable: true reasoning_effort: type: string enum: - none - minimal - low - medium - high - xhigh nullable: true per_file_view_window_char_limit: type: number nullable: true parallel_tool_calls: type: boolean nullable: true temperature: type: number nullable: true required: - enable_reasoner - put_inner_thoughts_in_kwargs - context_window_limit - max_tokens - max_reasoning_tokens - max_files_open - message_buffer_autoclear - verbosity_level - reasoning_effort - per_file_view_window_char_limit - parallel_tool_calls - temperature nullable: true entityId: type: string name: type: string required: - model - systemPrompt - toolIds - sourceIds - memoryVariables - toolVariables - tags - identityIds - toolRules - agentType - properties - entityId - name blocks: type: array items: type: object properties: entityId: type: string label: type: string value: type: string limit: type: number description: type: string preserveOnMigration: type: boolean nullable: true readOnly: type: boolean required: - entityId - label - value - limit - description - preserveOnMigration - readOnly relationships: type: array items: type: object properties: agentEntityId: type: string blockEntityId: type: string required: - agentEntityId - blockEntityId configuration: type: object properties: managerAgentEntityId: type: string managerType: type: string terminationToken: type: string maxTurns: type: number sleeptimeAgentFrequency: type: number maxMessageBufferLength: type: number minMessageBufferLength: type: number type: type: string enum: - classic - cluster - sleeptime - round_robin - supervisor - dynamic - voice_sleeptime version: type: string required: - agents - blocks - relationships - configuration - type - version put: description: Updates the current working version of a template from a snapshot summary: Set Current Template from Snapshot (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: template_version in: path required: true schema: type: string description: The template name with :dev version (e.g., my-template:dev) operationId: templates.setCurrentTemplateFromSnapshot requestBody: description: Body content: application/json: schema: nullable: true description: The template snapshot to set as the current version responses: '200': description: '200' content: application/json: schema: type: object properties: success: type: boolean message: type: string required: - success '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message '500': description: '500' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{project_id}/{template_version}/fork: post: description: Forks a template version into a new template summary: Fork Template (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: template_version in: path required: true schema: type: string description: The template version, formatted as {template-name}:{version-number} or {template-name}:latest operationId: templates.forkTemplate requestBody: description: Body content: application/json: schema: type: object properties: name: type: string pattern: ^[a-zA-Z0-9_-]+$ description: Optional custom name for the forked template. If not provided, a random name will be generated. responses: '200': description: '200' content: application/json: schema: type: object properties: name: type: string description: The exact name of the template id: type: string project_id: type: string project_slug: type: string latest_version: type: string description: The latest version of the template description: type: string template_deployment_slug: type: string description: The full name of the template, including version and project slug updated_at: type: string description: When the template was last updated required: - name - id - project_id - project_slug - latest_version - template_deployment_slug - updated_at '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{project_id}: post: description: Creates a new template from an existing agent or agent file summary: Create Template (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id operationId: templates.createTemplate requestBody: description: Body content: application/json: schema: discriminator: propertyName: type oneOf: - type: object properties: type: type: string enum: - agent agent_id: type: string description: The ID of the agent to use as a template, can be from any project name: type: string pattern: ^[a-zA-Z0-9_-]+$ description: Optional custom name for the template. If not provided, a random name will be generated. required: - type - agent_id summary: From Agent description: Create a template from an existing agent - type: object properties: type: type: string enum: - agent_file agent_file: type: object additionalProperties: nullable: true description: The agent file to use as a template, this should be a JSON file exported from the platform name: type: string pattern: ^[a-zA-Z0-9_-]+$ description: Optional custom name for the template. If not provided, a random name will be generated. update_existing_tools: type: boolean description: If true, update existing custom tools source_code and json_schema (source_type cannot be changed) required: - type - agent_file summary: From Agent File description: Create a template from an uploaded agent file summary: Create template description: The type of template to create, currently only agent templates are supported responses: '201': description: '201' content: application/json: schema: type: object properties: name: type: string description: The exact name of the template id: type: string project_id: type: string project_slug: type: string latest_version: type: string description: The latest version of the template description: type: string template_deployment_slug: type: string description: The full name of the template, including version and project slug updated_at: type: string description: When the template was last updated required: - name - id - project_id - project_slug - latest_version - template_deployment_slug - updated_at '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{template_name}: delete: description: Deletes all versions of a template with the specified name summary: Delete Template (Cloud-only) tags: - Templates parameters: - name: template_name in: path required: true schema: type: string description: The template name (without version) operationId: templates.deleteTemplateNoProject requestBody: description: Body content: application/json: schema: type: object properties: {} responses: '200': description: '200' content: application/json: schema: type: object properties: success: type: boolean required: - success '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message patch: description: Updates the current working version of a template from an agent file summary: Update Current Template from Agent File (Cloud-only) tags: - Templates parameters: - name: template_name in: path required: true schema: type: string description: The template name (without version) operationId: templates.updateCurrentTemplateFromAgentFileNoProject requestBody: description: Body content: application/json: schema: type: object properties: agent_file_json: type: object additionalProperties: nullable: true description: The agent file to update the current template version from update_existing_tools: default: false type: boolean description: If true, update existing custom tools source_code and json_schema (source_type cannot be changed) save_existing_changes: default: false type: boolean description: If true, Letta will automatically save any changes as a version before updating the template required: - agent_file_json responses: '200': description: '200' content: application/json: schema: type: object properties: success: type: boolean message: type: string required: - success '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message '500': description: '500' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{project_id}/{template_name}/name: patch: description: Renames all versions of a template with the specified name. Versions are automatically stripped from the current template name if accidentally included. summary: Rename Template (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: template_name in: path required: true schema: type: string description: The current template name (version will be automatically stripped if included) operationId: templates.renameTemplate requestBody: description: Body content: application/json: schema: type: object properties: new_name: type: string pattern: ^[a-zA-Z0-9_-]+$ description: The new name for the template required: - new_name responses: '200': description: '200' content: application/json: schema: type: object properties: success: type: boolean required: - success '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message '409': description: '409' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{project_id}/{template_name}/description: patch: description: Updates the description for all versions of a template with the specified name. Versions are automatically stripped from the current template name if accidentally included. summary: Update Template Description (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: template_name in: path required: true schema: type: string description: The template name (version will be automatically stripped if included) operationId: templates.updateTemplateDescription requestBody: description: Body content: application/json: schema: type: object properties: description: type: string description: The new description for the template responses: '200': description: '200' content: application/json: schema: type: object properties: success: type: boolean required: - success '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{project_id}/{name}/versions: get: description: List all versions of a specific template summary: List Template Versions (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: name in: path required: true schema: type: string description: The template name (without version) - name: offset in: query schema: oneOf: - type: string - type: number - name: limit in: query schema: type: string operationId: templates.listTemplateVersions responses: '200': description: '200' content: application/json: schema: type: object properties: versions: type: array items: type: object properties: version: type: string description: The version number created_at: type: string description: When the version was created message: type: string description: Version description message is_latest: type: boolean description: Whether this is the latest version required: - version - created_at - is_latest has_next_page: type: boolean total_count: type: number required: - versions - has_next_page - total_count '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{project_id}/{template_name}/deployments/{deployment_id}/migrate: post: description: Migrates a deployment to a specific template version summary: Migrate Deployment to Template Version (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: template_name in: path required: true schema: type: string description: The template name (without version) - name: deployment_id in: path required: true schema: type: string description: The deployment ID to migrate operationId: templates.migrateDeployment requestBody: description: Body content: application/json: schema: type: object properties: version: type: string description: The target template version to migrate to preserve_tool_variables: type: boolean description: Whether to preserve existing tool variables during migration preserve_core_memories: type: boolean description: Whether to preserve existing core memories during migration preserve_sources: type: boolean description: If true, existing agent sources will be preserved and merged with template sources during migration. If false, agent sources will be replaced with template sources. memory_variables: type: object additionalProperties: type: string description: Additional memory variables to apply during migration required: - version responses: '200': description: '200' content: application/json: schema: type: object properties: success: type: boolean message: type: string required: - success '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message '500': description: '500' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{template_name}/rollback: post: description: Rollback the current working version of a template to a previous saved version. If the current version has unsaved changes, they will be automatically saved as a new version before rollback. summary: Rollback Template to Previous Version (Cloud-only) tags: - Templates parameters: - name: template_name in: path required: true schema: type: string description: The template name (without version) operationId: templates.rollbackTemplateNoProject requestBody: description: Body content: application/json: schema: type: object properties: version: type: string description: The target version to rollback to (e.g., "1", "2", "latest"). Cannot be "current" or "dev". required: - version responses: '200': description: '200' content: application/json: schema: type: object properties: success: type: boolean message: type: string required: - success '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message '500': description: '500' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{project_id}/{template_name}/rollback: post: description: Rollback the current working version of a template to a previous saved version. If the current version has unsaved changes, they will be automatically saved as a new version before rollback. summary: Rollback Template to Previous Version (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: template_name in: path required: true schema: type: string description: The template name (without version) operationId: templates.rollbackTemplate requestBody: description: Body content: application/json: schema: type: object properties: version: type: string description: The target version to rollback to (e.g., "1", "2", "latest"). Cannot be "current" or "dev". required: - version responses: '200': description: '200' content: application/json: schema: type: object properties: success: type: boolean message: type: string required: - success '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message '500': description: '500' content: application/json: schema: type: object properties: message: type: string required: - message /v1/templates/{project_id}/{template_name}/agent-file: put: description: Updates the current working version of a template from an agent file summary: Update Current Template from Agent File (Cloud-only) tags: - Templates parameters: - name: project_id in: path required: true schema: type: string description: The project id - name: template_name in: path required: true schema: type: string description: The template name (without version) operationId: templates.updateCurrentTemplateFromAgentFile requestBody: description: Body content: application/json: schema: type: object properties: agent_file_json: type: object additionalProperties: nullable: true description: The agent file to update the current template version from update_existing_tools: default: false type: boolean description: If true, update existing custom tools source_code and json_schema (source_type cannot be changed) save_existing_changes: default: false type: boolean description: If true, Letta will automatically save any changes as a version before updating the template required: - agent_file_json responses: '200': description: '200' content: application/json: schema: type: object properties: success: type: boolean message: type: string required: - success '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message '500': description: '500' content: application/json: schema: type: object properties: message: type: string required: - message /v1/legacy-templates/{templateId}/migrates: post: description: Migrates a template from a legacy project to the default project. Only works if the template is currently in a legacy project. summary: Migrate Template from Legacy Project (Cloud-only) tags: - Templates parameters: - name: templateId in: path required: true schema: type: string description: The template ID operationId: templates.legacyMigration requestBody: description: Body content: application/json: schema: type: object properties: {} responses: '200': description: '200' content: application/json: schema: type: object properties: success: type: boolean message: type: string required: - success '400': description: '400' content: application/json: schema: type: object properties: message: type: string required: - message '404': description: '404' content: application/json: schema: type: object properties: message: type: string required: - message components: securitySchemes: bearerAuth: type: http scheme: bearer