Outcomes, results and health
Look up the REST routes for outcome stages, outcomes, the traced share, results, rankings and health, with their fields and who may call them.
The REST routes for outcomes, results and health, generated with npm run openapi from the schemas Handline validates every request with. Routes are under https://app.handline.io/api/v1 and take Authorization: Bearer <key or token>; the ids in braces are path parameters. The OpenAPI document is at https://app.handline.io/api/v1/openapi.json.
A GET or DELETE takes its fields as query parameters: numbers and true or false are read as such, and a repeated key is a list. Other methods take a JSON body with content-type: application/json.
GET /products/{productId}/stages#
Read the product’s outcome stages, in order, and its main goal.
Operation: outcomes.stages, MCP tool outcomes_stages. Who: owners, admins, editors and viewers (record.read); agent keys with read.
No query parameters.
PUT /products/{productId}/stages#
Set the product’s outcome stages from a template or a list. A stage with outcomes can be retired, not deleted.
Operation: outcomes.setStages, MCP tool outcomes_setStages. Who: owners and admins (products.settings); not agent keys.
| Body | Type | Required | Rules |
|---|---|---|---|
template | string | No | One of self-serve, sales-led. |
stages | object[] | No | 1 to 12 items. |
stages[].id | string | Yes | Matches ^[a-z][a-z0-9-]{1,30}$. |
stages[].label | string | Yes | 1 to 40 characters. |
stages[].hasValue | boolean | No | Default false. |
stages[].retired | boolean | No | Default false. |
mainStage | string | No |
POST /products/{productId}/outcomes#
Report an outcome: a stage reached by something you identify with your own id, with the visit token if you have one. Report every outcome, traced or not. The same stage and id reported twice is recorded once. A later stage without a token is joined to the visit of the earlier traced stage with the same id.
Operation: outcomes.report, MCP tool outcomes_report. Who: owners, admins and editors (outcomes.report); agent keys with report; product keys.
| Body | Type | Required | Rules |
|---|---|---|---|
stage | string | Yes | |
externalId | string | Yes | 1 to 200 characters. |
occurredAt | string | No | A date and time, ISO 8601 with an offset. |
token | string or null | No | At most 400 characters. |
value | object or null | No | |
value.amount | number | Yes | At least 0. |
value.currency | string | Yes | Matches ^[A-Z]{3}$. |
test | boolean | No | |
hashedEmail | string | No | Matches ^[0-9a-f]{64}$. |
GET /products/{productId}/outcomes#
List recent outcomes, by stage and whether they were traced.
Operation: outcomes.list, MCP tool outcomes_list. Who: owners, admins, editors and viewers (record.read); agent keys with read. Outside text: outcomes.[].externalId.
| Query | Type | Required | Rules |
|---|---|---|---|
stage | string | No | |
traced | boolean | No | |
limit | integer | No | From 1 to 500. Default 100. |
GET /products/{productId}/outcomes/traced-share#
The share of outcomes Handline can trace to a visit, per day and stage. A sudden drop means tracking is broken.
Operation: outcomes.tracedShare, MCP tool outcomes_tracedShare. Who: owners, admins, editors and viewers (record.read); agent keys with read.
| Query | Type | Required | Rules |
|---|---|---|---|
from | string | Yes | A date, YYYY-MM-DD. |
to | string | Yes | A date, YYYY-MM-DD. |
GET /products/{productId}/results#
Results for any concept, channel, cell, audience, page or placement over a range of days, with the sample behind every rate and cost. Group by a dimension and filter by others. Every rate and cost carries its sample size; below the call rules’ minimum it reads “sample too small” with how many more are needed. Never compute results yourself: read them here.
Operation: results.get, MCP tool results_get. Who: owners, admins, editors and viewers (record.read); agent keys with read.
| Query | Type | Required | Rules |
|---|---|---|---|
from | string | No | Matches ^\d{4}-\d{2}-\d{2}$. |
to | string | No | Matches ^\d{4}-\d{2}-\d{2}$. |
groupBy | string | No | One of product, concept, channel, cell, audience, page, placement. Default concept. |
attribution | string | No | One of visitDay, outcomeDay. Default visitDay. |
conceptId | string | No | |
channelId | string | No | |
cell | string | No | |
audienceId | string | No | |
pageId | string | No | |
placementId | string | No |
GET /products/{productId}/results/rankings#
Rank concepts within a cell, or cells within the product, by the ranking rule in the ground rules. An item below the minimum sample is listed as unranked, never placed. A ranking is descriptive: only an experiment calls a winner.
Operation: results.rankings, MCP tool results_rankings. Who: owners, admins, editors and viewers (record.read); agent keys with read.
| Query | Type | Required | Rules |
|---|---|---|---|
cell | string | No | |
from | string | No | Matches ^\d{4}-\d{2}-\d{2}$. |
to | string | No | Matches ^\d{4}-\d{2}-\d{2}$. |
attribution | string | No | One of visitDay, outcomeDay. Default visitDay. |
GET /products/{productId}/health/reconciliation#
Compare what the product reported, what Handline sent, and what each platform counted, with the traced share. Per channel and day: conversions Handline sent and the platform accepted against the platform’s own count, and the platform’s clicks against observed visits. Each comparison lists the usual harmless causes of a gap. A stale or failing platform side is “not comparable”, never a mismatch.
Operation: health.reconciliation, MCP tool health_reconciliation. Who: owners, admins, editors and viewers (record.read); agent keys with read.
| Query | Type | Required | Rules |
|---|---|---|---|
days | integer | No | From 3 to 60. Default 14. |
GET /products/{productId}/health/signals#
What the rules, reconciliation and drift checks currently flag, and the events they fired. Each signal fires once per state and clears itself when the cause goes away. Events are kept as fired, with the numbers and the rules version at the time.
Operation: health.signals, MCP tool health_signals. Who: owners, admins, editors and viewers (record.read); agent keys with read.
| Query | Type | Required | Rules |
|---|---|---|---|
kind | string | No | |
limit | integer | No | From 1 to 500. Default 100. |
Was this page helpful?