Critique draft retention
Critique a hook or script draft against this channel's own retention evidence (hook signals, best openings, steepest drop-offs). Returns risk, issues with suggested rewrites, and a rewritten draft. Runs async: poll the operation or pass webhookUrl. Costs 8 credits; credits are released if the run fails (for example, fewer than 5 videos with retention curves).
Request examples
curl -sS -X POST "https://hitfactorapp.com/api/v1/retention/critique" \
-H "Content-Type: application/json" \
-H "x-api-key: $HITFACTOR_API_KEY" \
-H "Idempotency-Key: req_2026_001" \
-d '{
"draftType": "hook",
"title": "Why Every AI Agent Breaks in Production",
"text": "Every developer builds an AI agent demo in an afternoon, then watches it loop forever in production. Here are the three fixes that actually hold up.",
"targetDurationSeconds": 5
}'const response = await fetch("https://hitfactorapp.com/api/v1/retention/critique", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.HITFACTOR_API_KEY!,
"Idempotency-Key": "req_2026_001",
},
body: JSON.stringify({
"draftType": "hook",
"title": "Why Every AI Agent Breaks in Production",
"text": "Every developer builds an AI agent demo in an afternoon, then watches it loop forever in production. Here are the three fixes that actually hold up.",
"targetDurationSeconds": 5
}),
})
const { data, meta } = await response.json()
console.log(data, meta)curl -sS -X POST "https://hitfactorapp.com/api/v1/mcp" \
-H "Content-Type: application/json" \
-H "x-api-key: $HITFACTOR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "critique_retention",
"arguments": {
"draftType": "hook",
"title": "Why Every AI Agent Breaks in Production",
"text": "Every developer builds an AI agent demo in an afternoon, then watches it loop forever in production. Here are the three fixes that actually hold up.",
"targetDurationSeconds": 5,
"requestId": "req_2026_001"
}
}
}'Parameters
Idempotency-KeyheaderstringUnique retry key (up to 255 characters). Replaying the same key and body returns the original response with 0 extra credits charged.
maxLength: 255Request body
Send a JSON object with Content-Type: application/json. Unknown keys are rejected with 400 invalid_input.
draftType"hook" | "script"requiredtitlestringmaxLength: 300textstringrequiredminLength: 1maxLength: 30000targetDurationSecondsintegermin: 5max: 7200webhookUrlstring (uri)maxLength: 2000Response (202 Accepted)
Returns HTTP 202 immediately with an operationId and pollUrl. Poll GET /operations/{operationId} (0 credits) or pass webhookUrl to receive the finished payload.
operationIdstringrequiredstatus"queued"requiredpollUrlstringrequired{
"data": {
"operationId": "apiop_01j9example0000000000000",
"status": "queued",
"pollUrl": "/api/v1/operations/apiop_01j9example0000000000000"
},
"meta": {
"requestId": "req_01j9example0000000000000",
"creditsCharged": 1,
"creditsRemaining": 499,
"replayed": false
}
}Completed operation result
When the async operation reaches status: "succeeded", this schema is returned inside data.result on GET /operations/{operationId} and webhook deliveries.
overallRisk"low" | "medium" | "high"requiredsummarystringrequiredchannelSignalsUsedstring[]requiredissuesobject[]requiredShow item fields
excerptstringrequiredreasonstringrequiredmatchedChannelPatternstringrequiredcitedVideoTitlestringsuggestedRewritestringrequiredrewrittenDraftstringrequired{
"overallRisk": "low",
"summary": "example_summary",
"channelSignalsUsed": [
"example_channelSignalsUsed"
],
"issues": [
{
"excerpt": "example_excerpt",
"reason": "example_reason",
"matchedChannelPattern": "example_matchedChannelPattern",
"citedVideoTitle": "example_citedVideoTitle",
"suggestedRewrite": "example_suggestedRewrite"
}
],
"rewrittenDraft": "Most AI agents pass a demo and fail on user two. Here are the three production guardrails that stop loops."
}Error responses
400invalid_input401Missing or invalid API key402insufficient_credits403insufficient_scope404operation_not_found409channel_sync_pending or idempotency_conflict429rate_limited