---
title: "Update Prompt"
method: PUT
path: "/prompts/{id}"
tags: ["Prompts"]
---

# Update Prompt

`PUT /prompts/{id}`

Update a prompt with new content or properties. Your production prompt stays safe—updates create new versions without affecting what's currently active.

**How it Works:**
- **Updating components:** Creates a new immutable version with fingerprinting. The new version is created but NOT activated, so you can test before going live.
- **Updating only properties (name/description):** Updates the prompt in-place without creating a new version.

**Version Safety:**
Old versions always point to their original prompts, preserving your message history and allowing you to roll back if needed.

## Path parameters

- `id` string, uuid, required — The prompt ID to update

## Request body

- UpdatePromptRequest
  - `name` string — Updated prompt name.
  - `description` string — Updated prompt description.
  - `role` string — Role key in the product mapping.
  - `source` 'customer' | 'participant' | 'greenflash' | 'agent' — Prompt source.
  - `components` ComponentUpdate[] — Updated components (if provided, creates new immutable prompt and version).
    - `content` string, required — Updated component content.
    - `componentId` string, uuid — The Greenflash component ID.
    - `externalComponentId` string — External component identifier.
    - `type` 'system' | 'user' | 'tool' | 'guardrail' | 'rag' | 'agent' | 'other' — Component type: system, user, tool, guardrail, rag, agent, or a custom type (other).
    - `source` 'customer' | 'participant' | 'greenflash' | 'agent' — Component source.
    - `name` string — Component name.
    - `isDynamic` boolean — Dynamic flag.

## Response `200`

Prompt updated successfully

- UpdatePromptResponse
  - `externalPromptId` string — The external prompt ID.
  - `promptId` string, uuid, required — The updated prompt ID.
  - `versionId` string, uuid, nullable, required — The version ID. Version is created/updated but not activated (activation happens via UI). Null if only prompt metadata was updated without components.

## Other responses

- `404` — Prompt not found
- `500` — Server error

## Changes

- **2026-02-18** `d5edd18f9685` — 2 breaking, 4 info
  - removed the enum value `endUser` of the request property `components/items/type`
  - removed the enum value `userModified` of the request property `components/items/type`
  - added the new `guardrail` enum value to the request property `components/items/type`
  - added the new `other` enum value to the request property `components/items/type`
  - …2 more
- **2025-11-24** `c1998d918478` — 1 info
  - api tag `Prompts` added
- **2025-10-29** `f1cd8a0e3bee` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/greenflash-ai/apis/greenflash-api-reference/changes/prompts/:id/put.md)

---

[API](https://skmtc.dev/greenflash-ai/apis/greenflash-api-reference.md) · [All operations](https://skmtc.dev/greenflash-ai/apis/greenflash-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/greenflash-ai/greenflash-api-reference/revisions/c566e560677d/schema)
