/smart-forms/:id/aggregate-analyticsAggregate Analytics
Trigger an AI aggregate analysis report across multiple smart form sessions
Overview
Triggers an asynchronous AI analysis job that produces an aggregate report across completed sessions. Optionally filter the sessions to include by providing sessionIds. Requires a minimum of 3 completed sessions. Returns a reportId and jobId that can be used to track progress.
Request
/smart-forms/:id/aggregate-analyticsHeaders
| Header | Value |
|---|---|
Authorization | Bearer fxk_live_<your-api-key> |
Content-Type | application/json |
Path Parameters
Request Body
Example Request
# All completed sessions
curl -X POST "https://api.formfex.com/api/v1/public/smart-forms/SMART_FORM_ID/aggregate-analytics" \
-H "Authorization: Bearer $FORMFEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
# Specific sessions only
curl -X POST "https://api.formfex.com/api/v1/public/smart-forms/SMART_FORM_ID/aggregate-analytics" \
-H "Authorization: Bearer $FORMFEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sessionIds": [
"s1b2c3d4-e5f6-7890-abcd-ef1234567890",
"s2b3c4d5-e6f7-8901-bcde-f12345678901",
"s3c4d5e6-f7a8-9012-cdef-123456789012"
]
}'Response
Response Fields
| Field | Type | Description |
|---|---|---|
reportId | string (UUID) | ID of the created analytics report record |
jobId | string (UUID) | ID of the dispatched AI job |
Error Cases
| Status | Description |
|---|---|
400 | Fewer than 3 completed sessions available (or matching the sessionIds filter) |
401 | Invalid or missing API key |
403 | Smart Forms feature not available on the current plan |
404 | Smart form not found or not owned by this API key |
429 | Monthly aggregate analytics limit reached |
Credit Cost
The credit cost is estimated as approximately 5 credits per session included in the analysis. Credits are deducted when the job completes, not when it is dispatched.
Checking Report Status
Use the smart form detail endpoint (Get Smart Form) to retrieve completed analytics reports from the analyticsReports field, or poll the AI job status via the job ID.
n8n
In n8n, this operation is available as Aggregate Analytics under the Smart Form resource in the Formfex node.