Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

feat: add delete/create template endpoint [LET-6309] (#6416)

Shubham Naik09bf146140a9
diff --git a/fern/openapi.json b/fern/openapi.json
index f091a05df..3b3140a76 100644
--- a/fern/openapi.json
+++ b/fern/openapi.json
@@ -16913,6 +16913,145 @@
}
}
}
+ },
+ "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/{project_id}/{template_name}": {
@@ -18054,6 +18193,70 @@
}
}
},
+ "/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"]
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/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.",