Enhance text
POST
/ai/enhance-text
Rewrite or generate one campaign field with an LLM. Requires a bearer session and is gated by the features.ai_text_enhancement flag. Throughput is capped per user (10 requests per minute by default).
context.field selects the system prompt and must be one of summary, story or milestone; any other value falls back to the summary prompt. text is capped at the server's maximum length.
Authorizations
BearerAuth
In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.
Type
HTTP (bearer)
Request Body
application/json
JSON
{
"action": "string",
"text": "string",
"context": {
"field": "string",
"title": "string",
"category": "string",
"goalAmount": 0,
"beneficiaryName": "string",
"milestoneTitle": "string",
"milestoneAmount": 0
}
}
Responses
Enhanced text
application/json
JSON
{
"enhancedText": "string"
}