Smart Insights API Beta
Smart Insights is powered by feedback events your application sends after evaluating a flag. ReleaseAnchor aggregates these events to produce per-environment metrics — success rate, feedback coverage, and average latency — visible on the flag detail page.
Smart Insights must be enabled for the target environment in the dashboard before feedback data is collected. See Smart Insights → for setup steps.
Authentication
All feedback endpoints require an API key in the Authorization header:
Authorization: ApiKey <YOUR_API_KEY>Report feedback
Send a single feedback event after evaluating a flag.
POST https://api.releaseanchor.com/v1/feedback/reportRequest body
{
"evaluationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"result": true,
"latencyMs": 142,
"errorType": null
}| Field | Type | Required | Description |
|---|---|---|---|
evaluationId | string | ✓ | The evaluation ID returned by the /v1/evaluate response. Links this feedback to a specific flag evaluation. |
result | boolean | ✓ | true if the flagged experience succeeded for the user; false if it failed. |
latencyMs | number | — | Time in milliseconds from flag evaluation to outcome. Used to compute average latency in Smart Insights. |
errorType | string | — | An optional application-level error label (e.g. "TIMEOUT", "API_ERROR"). For your own tracking; not currently surfaced in metrics. |
Example request
curl --location 'https://api.releaseanchor.com/v1/feedback/report' \
--header 'Content-Type: application/json' \
--header 'Authorization: ApiKey <YOUR_API_KEY>' \
--data '{
"evaluationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"result": true,
"latencyMs": 142,
"errorType": null
}'Response
Returns HTTP 204 No Content on success. No response body.
Unauthorized 401
{
"status": 401,
"error": "Unauthorized",
"message": "Missing or invalid Authorization header"
}Bulk report feedback
Send up to 500 feedback events in a single request. Use this for batch processing scenarios — e.g. after sending an email campaign where you know outcomes for many users at once.
POST https://api.releaseanchor.com/v1/feedback/bulkRequest body
{
"feedbacks": [
{
"evaluationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"result": true,
"latencyMs": 142,
"errorType": null
},
{
"evaluationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"result": false,
"latencyMs": 890,
"errorType": "TIMEOUT"
}
]
}| Field | Type | Required | Description |
|---|---|---|---|
feedbacks | array | ✓ | List of feedback events. Max 500 per request. Each item has the same fields as the single report body. |
Example request
curl --location 'https://api.releaseanchor.com/v1/feedback/bulk' \
--header 'Content-Type: application/json' \
--header 'Authorization: ApiKey <YOUR_API_KEY>' \
--data '{
"feedbacks": [
{ "evaluationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "result": true, "latencyMs": 142, "errorType": null },
{ "evaluationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "result": false, "latencyMs": 890, "errorType": "TIMEOUT" }
]
}'Response
Returns HTTP 204 No Content on success.
What gets aggregated
After receiving feedback events, ReleaseAnchor periodically aggregates the data per flag environment and computes:
| Metric | How it is calculated |
|---|---|
| Evaluations | Total evaluation events received for the environment |
| Feedback count | Total feedback events received |
| Feedback coverage | feedbackCount / totalEvaluations × 100 |
| Success rate | successCount / feedbackCount × 100 |
| Failure rate | failureCount / feedbackCount × 100 |
| Avg latency | Mean of all reported latencyMs values |
Feedback coverage reflects how consistently your integration reports outcomes. A low coverage percentage means Smart Insights metrics are based on a small sample — aim for coverage above 80% for reliable signals.
Integration pattern
- 1Evaluate the flag
Call
POST /v1/evaluateand capture theevaluationIdfrom the response (available in the JavaScript SDK as the return value ofevaluate()). - 2Run the feature
Execute the flagged code path for the user.
- 3Capture the outcome
Once you know whether the experience succeeded or failed, send a feedback event with the
evaluationIdandresult. - 4Optionally include latency
Measure the time from evaluation to outcome and include it as
latencyMsto populate the latency metric in Smart Insights.
const start = Date.now();
const evaluation = await client.evaluate("new-checkout", userId);
if (evaluation.value) {
try {
await runNewCheckout(userId);
await client.reportFeedback(evaluation.evaluationId, { result: true, latencyMs: Date.now() - start });
} catch (err) {
await client.reportFeedback(evaluation.evaluationId, { result: false, latencyMs: Date.now() - start, errorType: "CHECKOUT_ERROR" });
}
}Next steps
- JavaScript / Node.js SDK → — SDK methods for
evaluate,reportSuccess, andreportFailure - Smart Insights → — enable insights per environment and understand the dashboard metrics
- Evaluate Flag → — the evaluate endpoint that produces
evaluationId