Skip to content

Campaign AI chat​

POST
/ai/campaign-chat

Conversational assistant for the campaign-creation wizard. Requires a
bearer session; throughput is capped per user (10 requests per minute
by default).

The response is a Server-Sent Events stream (text/event-stream),
not a JSON document. Each event carries one JSON object:

  • {"type":"token","content":"…"} — one streamed text token
  • {"type":"campaign_data","data":{…}} — campaign fields the model extracted
  • {"type":"done"} — stream complete
  • {"type":"error","message":"…"} — the stream failed mid-flight

Only the most recent 30 messages of messages are sent to the model.

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
{
"messages": [
{
"role": "string",
"content": "string"
}
],
"extractedData": {
"additionalProperties": "string"
}
}

Responses​

Server-Sent Events stream of tokens and extracted campaign data.

text/event-stream
JSON
"string"

Playground​

Server
Authorization
Body

Samples​

Powered by VitePress OpenAPI

Built with VitePress