Skip to content
IForevents Docs
IForevents Docs
HomeDashboardGitHubPrivacyTermsSecurityIntroduction
Support and SLA

Formulas over named Insights queries

POST
/v1/analytics/insights/formulas

Authorization

AuthorizationBearer <token>

Session token issued by the accounts service (or the legacy /v1/auth routes).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/analytics/insights/formulas" \  -H "Content-Type: application/json" \  -d '{    "end": "2026-09-13T12:30:45Z",    "formulas": [      {        "expression": "A / B",        "label": "Purchases per buyer"      }    ],    "interval": "day",    "queries": [      {        "event": "purchase",        "metric": "total"      },      {        "event": "purchase",        "metric": "unique_users"      }    ],    "start": "2026-09-01T00:00:00Z",    "timezone": "UTC"  }'
{  "formulas": [    {      "expression": "(A / B)",      "label": "Purchases per buyer",      "points": [        {          "reason": "division_by_zero",          "t": "2026-09-01T00:00:00Z",          "v": null        }      ],      "total": null,      "total_reason": "division_by_zero",      "unit": "(events/users)"    }  ],  "interval": "day",  "queries": [    {      "key": "A",      "points": [        {          "t": "2026-09-01T00:00:00Z",          "v": 12        }      ],      "total": 12    },    {      "key": "B",      "points": [        {          "t": "2026-09-01T00:00:00Z",          "v": 0        }      ],      "total": 0    }  ],  "timezone": "UTC"}
end?string
Formatdate-time
formulas*array<>
groups?array<>
interval?string
queries*array<>
start?string
Formatdate-time
timezone?string