Skip to main content
The Attribution API computes credit assignment across touchpoints that led to a conversion. Supports six attribution models.

POST /api/v1/attribution

Compute attribution for a customer conversion. Rate limited to 100 requests/min. Editor or Admin.

Request Body

Attribution Models

model accepts exactly last_touch, first_touch, linear, time_decay, position_based, or shapley — an unrecognized value returns 400 with { "error": "model must be one of: ..." } (same validation on GET, see below).
The touchpoint window is anchored on the conversion, not “now.” computeAttribution fetches the 100 InteractionHistory rows immediately preceding (and including) the conversion event, ordered by timestamp descending from the conversion’s own timestamp — not from the current time. For a customer with more than 100 interactions total, anchoring on “now” previously meant a conversion that happened earlier in that history could fall outside the 100-row window and be silently excluded from its own attribution chain. Anchoring on the conversion’s timestamp guarantees the conversion (and its preceding touchpoints, up to the 100-row cap) are always included.

Example

Response (201)


GET /api/v1/attribution

Query attribution results. Editor or Admin.

Query Parameters

An unrecognized model value returns 400 with { "error": "model must be one of: ..." } — the same validation the POST endpoint applies.

Response