Update Prompt
Prompts
Update Prompt
PUT
Update Prompt
Updates an existing prompt. A new version snapshot is automatically created on every update, preserving the full change history.
This will update only the
Authentication
Requires JWT Bearer token (Cognito) with admin role.Path Parameters
string
required
Prompt UUID to updateFormat: UUIDExample:
550e8400-e29b-41d4-a716-446655440000Request Body
All fields are optional — only provide the fields you want to update.string
Updated prompt nameMax length: 200
string
Updated agent section assignmentValues:
parser, gap_detector, risk_analysis, report_generationstring
Updated sub-sectionMax length: 100
string
Updated frontend route association
array
Updated list of applicable risk categories
array
Updated tags
string
Updated system prompt
string
Updated user prompt templateSupports variable substitution:
{{category_1}}, {{category_2}}, {{categories}}string
Updated tone instructionsMax length: 500
string
Updated output format instructionsMax length: 5000
array
Updated few-shot examplesEach example has:
input(string, required): Example user inputoutput(string, required): Expected model output
object
Updated context configurationProperties:
persona(string): System persona definitionsources(array): List of reference sourcesconstraints(string): Operational constraintsguardrails(string): Safety guardrails
boolean
Set to true to activate this promptMay deactivate other prompts in the same section to maintain the rule: only one active prompt per section.
Response
object
The updated prompt object with incremented version number
Example Request
Example Response
Error Responses
error
Validation error (invalid field values)
error
Missing or invalid Bearer token
error
Forbidden — admin role required
error
Prompt not found
error
Conflict — concurrent update detectedThis occurs when another user updated the prompt between your read and write operations.
Versioning
On every update:- Current prompt state is snapshotted to
prompt_versionstable - Prompt
versionis incremented - Prompt record is updated with new values
- A change record is created in
prompt_changestable with:changeType: UPDATEchangesfield containing field-level diffs (old vs new values)authorId(user who made the change)version(new version number)
Conflict Detection
The update endpoint implements optimistic locking:- If the prompt was modified by another user since you last read it, you’ll receive a
409 Conflicterror - Re-fetch the latest version, review changes, and retry your update
Partial Updates
Only the fields you provide in the request body are updated:tags field, leaving all other fields unchanged.
Source Code
Implementation:packages/api/src/prompts/prompts.controller.ts:159