# Update preset prompt div strong 🔨 In Development — This section is still being developed and may change. Update an existing preset prompt's name, content, icon, or order. #### Path Parameters **`assistant_id`** string required The unique identifier of the assistant. **`prompt_id`** integer required The unique identifier of the preset prompt to update. #### Request Body **`name`** string optional The display name of the preset prompt (1-255 characters). **`value`** string optional Full prompt text (minimum 1 character). **`icon_id`** string optional Identifier of a predefined icon from the catalog. [List icons →](/docs/api-reference/icons/list) — or — **`icon`** object optional Custom icon metadata used when `icon_id` is not provided. details summary Show properties **`id`** string · Stable icon identifier **`url`** string · Absolute URL of the icon asset (SVG/PNG) **`alt`** string · Accessible description for the icon **`order_index`** integer optional Order for sorting preset prompts (≥0). **`is_active`** boolean optional Whether the preset prompt is active and visible. Update Content ```bash curl https://api.freddy.aitronos.com/v1/assistants/ass_0c23daea5e34/preset-prompts/1 \ -X PUT \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Updated Welcome Message", "value": "Hello! Welcome to our support. How can I assist you today?", "icon_id": "icon_welcome" }' ``` ```python import requests response = requests.put( "https://api.freddy.aitronos.com/v1/assistants/ass_0c23daea5e34/preset-prompts/1", headers={ "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" }, json={ "name": "Updated Welcome Message", "value": "Hello! Welcome to our support. How can I assist you today?", "icon_id": "icon_welcome" } ) prompt = response.json() print(f"Updated preset prompt: {prompt['preset_prompt_id']}") ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/assistants/ass_0c23daea5e34/preset-prompts/1', { method: 'PUT', headers: { 'Authorization': `Bearer ${api_key}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Updated Welcome Message', value: 'Hello! Welcome to our support. How can I assist you today?', icon_id: 'icon_welcome' }) }); const prompt = await response.json(); console.log(`Updated preset prompt: ${prompt.preset_prompt_id}`); ``` Reorder Prompt ```bash curl https://api.freddy.aitronos.com/v1/assistants/ass_0c23daea5e34/preset-prompts/1 \ -X PUT \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "order_index": 2 }' ``` ```python import requests response = requests.put( "https://api.freddy.aitronos.com/v1/assistants/ass_0c23daea5e34/preset-prompts/1", headers={ "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" }, json={ "order_index": 2 } ) prompt = response.json() ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/assistants/ass_0c23daea5e34/preset-prompts/1', { method: 'PUT', headers: { 'Authorization': `Bearer ${api_key}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ order_index: 2 }) }); const prompt = await response.json(); ``` Deactivate Prompt ```bash curl https://api.freddy.aitronos.com/v1/assistants/ass_0c23daea5e34/preset-prompts/1 \ -X PUT \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "is_active": false }' ``` ```python import requests response = requests.put( "https://api.freddy.aitronos.com/v1/assistants/ass_0c23daea5e34/preset-prompts/1", headers={ "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" }, json={ "is_active": False } ) prompt = response.json() ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/assistants/ass_0c23daea5e34/preset-prompts/1', { method: 'PUT', headers: { 'Authorization': `Bearer ${api_key}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ is_active: false }) }); const prompt = await response.json(); ``` ## Response ## Returns A [Preset Prompt object](/docs/api-reference/objects/preset-prompt-object). 200 OK ```json { "preset_prompt_id": 1, "preset_prompt_name": "Updated Welcome Message", "preset_prompt_value": "Hello! Welcome to our support. How can I assist you today?", "preset_prompt_icon": { "id": "icon_welcome", "url": "https://cdn.aitronos.com/icons/icon-welcome.svg", "alt": "Speech bubble icon" }, "order_index": 2, "is_active": false, "created_at": "2025-01-20T10:30:00Z", "updated_at": "2025-01-20T15:45:00Z" } ``` Errors ```json { "message": "Preset prompt not found", "detail": "Preset prompt with ID '1' not found for assistant 'ass_0c23daea5e34'", "error_code": "PRESET_PROMPT_NOT_FOUND", "status_code": 404, "path": "/v1/assistants/ass_0c23daea5e34/preset-prompts/1", "method": "PUT" } ```