GET /api/v1/algorithm-models
List all algorithm models. Supports cursor-based pagination.Response
POST /api/v1/algorithm-models
Create a new algorithm model.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Unique model key |
name | string | Yes | Display name |
modelType | string | Yes | "scorecard", "bayesian", or "gradient_boosted" |
description | string | No | Description |
status | string | No | Default: "draft" |
config | object | No | Model-specific configuration |
targetField | string | No | Target variable field name |
targetSchemaKey | string | No | Schema key containing the target |
predictors | array | No | Predictor feature definitions |
learningConfig | object | No | Online learning configuration |
Example
201 Created
GET /api/v1/algorithm-models/
Get model details including version history. Response:200 OK with the model object and versions array.
PUT /api/v1/algorithm-models/
Update a model’s configuration, status, metrics, or learning config.Request Body
All fields are optional. Only provided fields are updated.| Field | Type | Description |
|---|---|---|
name | string | Updated name |
description | string | Updated description |
status | string | Updated status |
config | object | Updated model config |
targetField | string | Updated target field |
predictors | array | Updated predictor list |
metrics | object | Updated metrics |
modelState | object | Updated model state (weights, coefficients) |
learningConfig | object | Updated learning config |
outcomeWeights | object | Per-outcome scoring weights |
interactionFeatures | object | Interaction feature configuration |
evolutionConfig | object | Auto-evolution tier thresholds |
200 OK
DELETE /api/v1/algorithm-models/
Delete a model. Response:204 No Content
POST /api/v1/algorithm-models//score
Score a single customer against the model.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
attributes | object | No | Customer attribute vector |
Response
POST /api/v1/algorithm-models//score-offer-set
Score a set of offers for a customer. Returns per-offer propensity scores with optional interaction history features.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
customerAttributes | object | No | Customer feature vector |
offers | array | Yes | Array of { id, name?, attributes } |
customerId | string | No | If provided, fetches real interaction summaries from DB |
context | object | No | Real-time context features |
Response
POST /api/v1/algorithm-models//train
Train (or retrain) a model. Creates a new version snapshot and updates metrics history.Response
Returns the updated model with incrementedversion, refreshed metrics, and status set to "active".
POST /api/v1/algorithm-models//upgrade
Upgrade a model to the next tier (scorecard to bayesian, or bayesian to gradient_boosted). Optionally creates a champion/challenger experiment.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
createExperiment | boolean | No | If true, auto-creates a 50/50 experiment. Default: false |
Response
201 Created
GET /api/v1/algorithm-models//evolution-history
View model evolution config, progress toward the next tier, and a timeline of version transitions.Response
Roles
| Endpoint | Allowed Roles |
|---|---|
GET /algorithm-models | admin, editor, viewer |
POST /algorithm-models | admin, editor |
PUT /algorithm-models/{id} | admin, editor |
DELETE /algorithm-models/{id} | admin, editor |
POST /{id}/score | any authenticated |
POST /{id}/score-offer-set | any authenticated |
POST /{id}/train | admin, editor |
POST /{id}/upgrade | admin, editor |
GET /{id}/evolution-history | any authenticated |