Outcomes
Record what your agent did and what it led to. Approval and edits improve model choice; engagement and revenue are reported, not learned from.
Outcomes
When an agent works through BrainstormRouter, the model request is only the start. The agent writes a post, a person edits and approves it, it goes out, replies arrive two days later and a deal closes two weeks after that.
The outcome ledger connects those facts. You record the action (the post, the email, the ad) once, link the request ids that produced it, and report outcome events against it for as long as they keep arriving.
The three calls
| Step | REST | MCP tool | SDK |
|---|---|---|---|
| Record an action | POST /v1/outcomes/actions | br_outcome_action_record | client.outcomes.recordAction |
| Report outcomes | POST /v1/outcomes/actions/{actionId}/events | br_outcome_report | client.outcomes.report |
| Read the report | GET /v1/outcomes/summary | br_outcome_summary | client.outcomes.summary |
| Read one action | GET /v1/outcomes/actions/{actionId} | — | client.outcomes.getAction |
Writes need router.write; reads need router.read. An OAuth key with the completions or tools scope can use all of them.
Record an action
curl -X POST https://api.brainstormrouter.com/v1/outcomes/actions \
-H "Authorization: Bearer $BR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"idempotency_key": "launch-post-1",
"kind": "post",
"channel": "linkedin",
"campaign": "q4-launch",
"external_ref": "urn:li:share:7261",
"task_type": "copywriting",
"request_ids": ["req_0193…", "req_0194…"]
}'
| Field | Notes |
|---|---|
idempotency_key | Required. Recording the same key again returns the same action (created: false). |
kind | post, email, dm, ad, landing_page, call_script or other. |
channel | Free text, stored lower-case: linkedin, x, email. |
campaign | Your label, for grouping. |
external_ref | The vendor's id for the post or message. An opaque id — never an email address or a name. |
task_type | The task type the routing loop learns under. |
request_ids | Up to 20 BrainstormRouter request ids that produced the action. |
occurred_at | When it happened, ISO-8601 UTC. Defaults to now. Not in the future, at most 90 days back. |
The model is looked up, not reported
There is no model field. For each request id, BrainstormRouter reads its own usage record for your account and stores the model that actually served the request and what it cost.
A request id that is not in your usage records is not linked. It comes back in unresolved_request_ids, and the response does not say whether the id belongs to someone else, failed, or has not been written yet. If you record an action immediately after a completion and an id is unresolved, send the same action again with the same idempotency_key: a replay links the ids that now resolve and changes nothing else.
Report outcomes
curl -X POST https://api.brainstormrouter.com/v1/outcomes/actions/$ACTION_ID/events \
-H "Authorization: Bearer $BR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"events": [
{ "signal": "edited", "value": 0.15, "idempotency_key": "review-1-edit" },
{ "signal": "approved", "idempotency_key": "review-1-approve" },
{ "signal": "reply", "value": 2, "occurred_at": "2026-11-11T09:12:00Z", "idempotency_key": "replies-2026-11-11" }
]
}'
Up to 50 events per call. Events are append-only. Each needs an idempotency_key that is unique within the action; a repeated key is not recorded twice, and the first value stands.
occurred_at is UTC, must not be in the future, and must not be earlier than the action. It defaults to now. If one event in a batch is invalid, nothing in the batch is recorded.
Signals
| Signal | Group | value |
|---|---|---|
approved, rejected, published | Human judgement | none |
edited | Human judgement | edit ratio 0–1, required |
impression, click, reaction, comment, share, reply | Engagement | count, default 1 |
unsubscribe, complaint, bounce | Negative | count, default 1 |
meeting_booked, signup, conversion | Business | count, default 1 |
revenue | Business | US dollars, required |
The edit ratio is how much of the output the person changed: 0 means they shipped it untouched, 1 means they rewrote it.
What routing learns from, and what it does not
Only five signals change which model BrainstormRouter picks next time:
| Signal | Reward |
|---|---|
approved | 1.0 |
rejected | 0.0 |
edited | 1 − edit ratio |
complaint | 0.0 |
unsubscribe | 0.25 |
They are the signals that are fast and that say something about the text the model wrote. Each is applied to the model or models that served the action's linked requests, through the same learning path as POST /v1/feedback.
A reward is applied once per action and model for the human verdict (approved, rejected, edited) and once for audience pushback (complaint, unsubscribe). Reporting approved ten times moves nothing after the first. When one call carries both an edit and an approval, the lower reward is used. The response lists what was applied under routing.applied.
Impressions, clicks, reactions, comments, shares, replies, bounces, meetings, signups, conversions and revenue are recorded and reported. They do not change routing. A conversion two weeks later depends on the audience, the offer, the timing and the channel far more than on which model drafted the copy, and there are too few of them to separate those causes. BrainstormRouter does not claim that revenue teaches model choice. published is also recorded only: it says the action happened, not that the draft was good.
An action with no linked request teaches nothing, because there is no model to credit.
Read the report
curl "https://api.brainstormrouter.com/v1/outcomes/summary?group_by=campaign&since=2026-10-01T00:00:00Z" \
-H "Authorization: Bearer $BR_API_KEY"
| Parameter | Notes |
|---|---|
group_by | model (default), channel, campaign, kind, task_type |
since, until | ISO-8601 UTC. Default: the last 30 days. |
kind, channel, campaign, task_type | Exact-match filters. |
The window selects actions by when they happened. Every outcome recorded for those actions is counted, however late it arrived — so a campaign's row keeps filling in as replies and revenue come back.
Each group, and totals, has:
| Field | Meaning |
|---|---|
actions | Actions in the group |
approved, rejected, approval_rate | approved / (approved + rejected) |
edited, mean_edit_ratio | Mean edit ratio over edited events |
published, impressions, clicks, reactions, comments, shares, replies | Summed counts |
unsubscribes, complaints, bounces | Summed counts |
meetings, signups, conversions, revenue_usd | Summed counts and dollars |
model_cost_usd | Cost of the linked requests, from your usage records |
cost_per_reply_usd, cost_per_conversion_usd | model_cost_usd divided by replies or conversions |
A ratio with nothing to divide by is null — never 0 and never infinity.
When you group by model, an action produced by several models is counted in each model's row, with only that model's request cost. The rows then add up to more than totals, which counts each action once. Actions with no linked request are in the row whose key is null.
One summary aggregates at most 5,000 actions, newest first. If more matched, truncated is true: narrow the window or add a filter.
SDKs
import BrainstormRouter from "brainstormrouter";
const br = new BrainstormRouter({ apiKey: process.env.BR_API_KEY! });
const { action } = await br.outcomes.recordAction({
idempotency_key: "launch-post-1",
kind: "post",
channel: "linkedin",
request_ids: [requestId],
});
await br.outcomes.report(action.id, [{ signal: "approved", idempotency_key: "review-1" }]);
const report = await br.outcomes.summary({ group_by: "model" });
import os
from brainstormrouter import BrainstormRouter
br = BrainstormRouter(api_key=os.environ["BR_API_KEY"])
recorded = br.outcomes.record_action(
"launch-post-1", "post", channel="linkedin", request_ids=[request_id]
)
br.outcomes.report(
recorded["action"]["id"],
[{"signal": "approved", "idempotency_key": "review-1"}],
)
report = br.outcomes.summary(group_by="model")
Limits
| Limit | Value |
|---|---|
| Request ids per action | 20 |
| Events per call | 50 |
| Events per action | 10,000 |
channel, task_type | 64 characters |
campaign, idempotency_key, request id | 128 characters |
external_ref | 256 characters |
| Events returned with an action | 500, oldest first |
Actions and events cannot be edited or deleted through the API.
POST /v1/feedback and this ledger
POST /v1/feedback/{requestId} still works and is unchanged for coding outcomes (code_compiled, tests_passed, …). Use it when the outcome belongs to one request. Use the ledger when the outcome belongs to something done in the world, arrives late, or arrives more than once.
/v1/feedback now also looks the request id up in your usage records. When it finds the request, the model on that record is credited and a model_used that disagrees is ignored; the response reports model_source: "usage_record". When it does not find it, model_used is used as before (model_source: "caller").