Review an Analyze agent prompt
POST
/api/v3/agents/analyze/prompt-review
const url = 'https://api.tryletterhead.com/api/v3/agents/analyze/prompt-review';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"api":true,"prompt":"Tell me which newsletter made the most revenue last month.","scope":["the-daily"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryletterhead.com/api/v3/agents/analyze/prompt-review \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "api": true, "prompt": "Tell me which newsletter made the most revenue last month.", "scope": [ "the-daily" ] }'Review an Analyze agent’s prompt before activation and return a structured assessment — whether it’s fully in scope, specific issues to fix, any out-of-scope asks, and a suggested rewrite.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
api
required
Required. Set to true to authenticate with an API key.
boolean
prompt
required
The prompt to review, up to 1500 characters.
string
scope
Optional list of newsletters the agent is scoped to, for context.
Array<string>
Example
{ "api": true, "prompt": "Tell me which newsletter made the most revenue last month.", "scope": [ "the-daily" ]}Responses
Section titled “ Responses ”200 OK
Media type application/json
object
items
object
compatible
boolean
issues
Array<object>
object
concern
string
fix
string
outOfScopeFeatures
Array<string>
suggestedPrompt
string
suggestedRewrite
string
message
string
total
integer
Example
{ "items": { "compatible": false, "issues": [ { "concern": "The prompt asks about revenue, which the agent can't see.", "fix": "Ask about engagement metrics instead, like open or click rate." } ], "outOfScopeFeatures": [ "revenue analysis" ], "suggestedPrompt": "Tell me which newsletter had the highest open rate last month.", "suggestedRewrite": "Tell me which newsletter had the highest open rate last month." }, "message": "", "total": 1}Still can’t find what you need? Contact support.