List Prompts
curl --request GET \
--url https://api.example.com/api/admin/prompts/listimport requests
url = "https://api.example.com/api/admin/prompts/list"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/admin/prompts/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/admin/prompts/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/admin/prompts/list"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/admin/prompts/list")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/admin/prompts/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"401": {},
"403": {},
"data": {
"data.prompts": [
{
"prompts[].id": "<string>",
"prompts[].name": "<string>",
"prompts[].section": "<string>",
"prompts[].subSection": "<string>",
"prompts[].route": "<string>",
"prompts[].categories": [
{}
],
"prompts[].tags": [
{}
],
"prompts[].version": 123,
"prompts[].isActive": true,
"prompts[].systemPrompt": "<string>",
"prompts[].userPromptTemplate": "<string>",
"prompts[].tone": "<string>",
"prompts[].outputFormat": "<string>",
"prompts[].fewShot": [
{}
],
"prompts[].context": {},
"prompts[].commentsCount": 123,
"prompts[].createdAt": "<string>",
"prompts[].updatedAt": "<string>"
}
],
"data.total": 123,
"data.page": 123,
"data.limit": 123,
"data.totalPages": 123
}
}Prompts
List Prompts
GET
/
api
/
admin
/
prompts
/
list
List Prompts
curl --request GET \
--url https://api.example.com/api/admin/prompts/listimport requests
url = "https://api.example.com/api/admin/prompts/list"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/admin/prompts/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/admin/prompts/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/admin/prompts/list"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/admin/prompts/list")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/admin/prompts/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"401": {},
"403": {},
"data": {
"data.prompts": [
{
"prompts[].id": "<string>",
"prompts[].name": "<string>",
"prompts[].section": "<string>",
"prompts[].subSection": "<string>",
"prompts[].route": "<string>",
"prompts[].categories": [
{}
],
"prompts[].tags": [
{}
],
"prompts[].version": 123,
"prompts[].isActive": true,
"prompts[].systemPrompt": "<string>",
"prompts[].userPromptTemplate": "<string>",
"prompts[].tone": "<string>",
"prompts[].outputFormat": "<string>",
"prompts[].fewShot": [
{}
],
"prompts[].context": {},
"prompts[].commentsCount": 123,
"prompts[].createdAt": "<string>",
"prompts[].updatedAt": "<string>"
}
],
"data.total": 123,
"data.page": 123,
"data.limit": 123,
"data.totalPages": 123
}
}Returns a paginated list of AI prompts with optional filtering by section, route, tag, search term, and active status.
Authentication
Requires JWT Bearer token (Cognito) with admin role.Query Parameters
string
Filter by agent pipeline sectionValues:
parser, gap_detector, risk_analysis, report_generationExample: gap_detectorstring
Filter by associated frontend routeExample:
/assessments/:id/gap-detectorstring
Filter by a specific tagExample:
productionstring
Full-text search across prompt name, system prompt, and user prompt templateExample:
market riskboolean
Filter by active status
true— active prompts onlyfalse— inactive prompts only- omit — all prompts
number
default:"1"
Page number (1-indexed)Minimum: 1Example:
2number
default:"20"
Number of results per pageMinimum: 1
Maximum: 100
Default: 20
Maximum: 100
Default: 20
Response
object
Paginated prompt list container
array
Array of prompt objects
string
Prompt UUID
string
Human-readable prompt name (max 200 characters)Example:
Gap Detection — Market Risk v2string
Agent pipeline sectionValues:
parser, gap_detector, risk_analysis, report_generationstring
Optional sub-section grouping (max 100 characters)Example:
Market Riskstring
Frontend route that uses this promptExample:
/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"]number
Current version number (auto-incremented on update)
boolean
Whether this prompt is active and used by Bedrock agentsOnly one prompt per section should be active at a time.
string
System-level prompt establishing persona, task, and constraints
string
User-turn prompt template with variable substitution supportVariables:
{{category_1}}, {{category_2}}, {{categories}}string
Tone and style instructions (max 500 characters)Example:
Professional, analytical, concise. Use bullet points.string
Output format instructions (max 5000 characters)Example:
Return JSON with keys: gaps, severity, recommendationsarray
Few-shot examples for model guidanceEach example has:
input(string): Example user inputoutput(string): Expected model output
object
Additional context configuration
persona(string): Persona definitionsources(array): Reference sourcesconstraints(string): Operational constraintsguardrails(string): Safety guardrails
number
Number of comments on this prompt (denormalized for performance)
string
ISO 8601 timestamp of creation
string
ISO 8601 timestamp of last update
number
Total number of prompts matching the filters
number
Current page number (1-indexed)
number
Number of results per page
number
Total number of pages
Example Request
curl -X GET "https://api.example.com/api/admin/prompts/list?section=gap_detector&isActive=true&page=1&limit=10" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Example Response
{
"data": {
"prompts": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Gap Detection — Market Risk v2",
"section": "gap_detector",
"subSection": "Market Risk",
"route": "/assessments/:id/gap-detector",
"categories": ["Market Risk"],
"tags": ["v2", "production", "reviewed"],
"version": 2,
"isActive": true,
"systemPrompt": "You are an expert agricultural risk analyst specializing in CGIAR research programmes. Analyze the provided business plan document and identify gaps in the risk assessment across the specified categories.",
"userPromptTemplate": "Given the following business plan section:\n\n{{document_excerpt}}\n\nIdentify gaps in risk coverage for the following categories: {{categories}}",
"tone": "Professional, analytical, concise. Use bullet points for lists. Avoid jargon.",
"outputFormat": "Return a JSON object with keys: 'gaps' (array of strings), 'severity' (low|medium|high), 'recommendations' (array of strings)",
"fewShot": [
{
"input": "What are the main market risks for smallholder farmers?",
"output": "The main market risks include price volatility, lack of market access, and limited contract farming opportunities."
}
],
"context": {
"persona": "You are an expert agricultural risk analyst specializing in CGIAR research programmes.",
"sources": ["CGIAR Research Programs", "FAO Risk Framework"],
"constraints": "Respond only based on the provided document. Do not speculate beyond the evidence.",
"guardrails": "Do not provide specific investment advice. Do not name individual companies."
},
"commentsCount": 3,
"createdAt": "2026-02-20T10:00:00.000Z",
"updatedAt": "2026-03-01T14:30:00.000Z"
}
],
"total": 1,
"page": 1,
"limit": 10,
"totalPages": 1
}
}
Error Responses
error
Missing or invalid Bearer token
error
Forbidden — admin role required
Source Code
Implementation:packages/api/src/prompts/prompts.controller.ts:53⌘I