Create Prompt
Prompts
Create Prompt
POST
Create Prompt
Creates a new AI prompt. A version snapshot (v1) is automatically created. The prompt is inactive by default unless
isActive is explicitly set to true.
Authentication
Requires JWT Bearer token (Cognito) with admin role.Request Body
string
required
Human-readable prompt nameMin length: 1
Max length: 200Example:
Max length: 200Example:
Gap Detection — Market Risk v2string
required
The agent pipeline section this prompt belongs toValues:
parser, gap_detector, risk_analysis, report_generationDetermines which Bedrock agent will use it.string
Optional sub-section for further grouping within a sectionMax length: 100Example:
Market Riskstring
Frontend route that uses this prompt — useful for filtering in the Prompt Manager UIExample:
/assessments/:id/gap-detectorarray
Risk category names this prompt applies toExample:
["Market Risk", "Credit Risk"]array
Free-form tags for filtering and organizationExample:
["v2", "production", "reviewed"]string
required
The system-level prompt sent to the model to establish persona, task, and constraintsMin length: 1Example:
You are an expert agricultural risk analyst. Analyze the provided business plan document and identify gaps in the risk assessment across the specified categories.string
required
The user-turn prompt templateMin length: 1Supports variable substitution:
{{category_1}}— First category{{category_2}}— Second category{{categories}}— Comma-separated list of all categories
string
Tone and style instructions for the model responseMax length: 500Example:
Professional, analytical, concise. Use bullet points for lists. Avoid jargon.string
Instructions for how the model should format its outputMax length: 5000Example:
Return a JSON object with keys: "gaps" (array of strings), "severity" (low|medium|high), "recommendations" (array of strings)array
Few-shot examples to guide model behaviorEach example has:
input(string, required): Example user inputoutput(string, required): Expected model output
object
Additional context configuration for persona, sources, constraints, and guardrailsProperties:
persona(string): System persona definitionsources(array): List of reference sourcesconstraints(string): Operational constraintsguardrails(string): Safety guardrails
boolean
default:"false"
Whether this prompt is active and used by Bedrock agentsOnly one prompt per section should be active at a time.
Response
object
The created prompt objectIncludes all fields from the request plus:
id(string): Generated UUIDversion(number): Initial version (1)commentsCount(number): Initial count (0)createdById(string): UUID of creating userupdatedById(string): UUID of creating usercreatedAt(string): ISO 8601 timestampupdatedAt(string): ISO 8601 timestamp
Example Request
Example Response
Error Responses
error
Validation error (missing required fields, invalid length, etc.)
error
Missing or invalid Bearer token
error
Forbidden — admin role required
Versioning
When a prompt is created:- The prompt record is created in the
promptstable withversion: 1 - A snapshot is automatically saved to
prompt_versionstable - A change record is created in
prompt_changestable with typeCREATE
Source Code
Implementation:packages/api/src/prompts/prompts.controller.ts:64