POST/smart-forms/:id/aggregate-analytics

Aggregate Analytics

Trigger an AI aggregate analysis report across multiple smart form sessions

Scope: SMART_FORMS_ANALYTICS

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

POST/smart-forms/:id/aggregate-analytics

Headers

HeaderValue
AuthorizationBearer fxk_live_<your-api-key>
Content-Typeapplication/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

FieldTypeDescription
reportIdstring (UUID)ID of the created analytics report record
jobIdstring (UUID)ID of the dispatched AI job

Error Cases

StatusDescription
400Fewer than 3 completed sessions available (or matching the sessionIds filter)
401Invalid or missing API key
403Smart Forms feature not available on the current plan
404Smart form not found or not owned by this API key
429Monthly 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.