Topolo Docs Topolo Platform
Open workspace

Publish lead scoring model

Freeze the draft as the next model version, make it current and rescore every active contact (up to 5000; truncated says when more remain, finish with scoring.recompute). The first time a contact qualifies Nurture records one mql lifecycle event (journey trigger and goal, segment event condition) and queues a handoff to every active connector with lead_handoff (TopoloCRM: a follow-up task on the linked CRM contact; TopoloEngage: enrolment into the connector's Engage campaign from its seat, skipped for an archived Engage contact or an address with a hard bounce, complaint or wrong-person block); without one the contact stays in Nurture (scoring.qualified.list, segment condition lead_score).

Outcome

Freeze the draft as the next model version, make it current and rescore every active contact (up to 5000; truncated says when more remain, finish with scoring.recompute). The first time a contact qualifies Nurture records one mql lifecycle event (journey trigger and goal, segment event condition) and queues a handoff to every active connector with lead_handoff (TopoloCRM: a follow-up task on the linked CRM contact; TopoloEngage: enrolment into the connector's Engage campaign from its seat, skipped for an archived Engage contact or an address with a hard bounce, complaint or wrong-person block); without one the contact stays in Nurture (scoring.qualified.list, segment condition lead_score).

Before you start

  • Verify identity and pin the intended organization and environment before discovering the action.
  • Discover a granted Nurture workspace. The application permission is workspace:write; required workspace access is read_write. A permission alone does not supply a workspace grant.
  • Organization and workspace come from verified context. Select resourceType/resourceId separately from action input; body fields cannot grant a different organization or workspace. The first authorized product action can initialize an identity-only workspace mirror.
  • Obtain authorization for the documented effect or personal-data export before supplying CLI --confirm or MCP confirm:true.

Discover the target

topolo whoami --json
topolo actions get app_topolo_nurture.scoring_model.publish --detail --json
topolo resources topolo-nurture --json
topolo workspaces list topolo-nurture --json

Request

POST /api/scoring/model/publish

Save action input as payload.json. The reviewed plan separates path identifiers, query fields and HTTP body. Set NURTURE_WORKSPACE_ID from granted resource discovery; it is separate from action input.

Inspect and test this action in the signed action console. A test response still requires the verification below.

Input fields

Use an empty JSON object; verified credential and resource context are separate.

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {},
  "additionalProperties": false
}

Effects

  • Stores an immutable model version and makes it current.
  • Rescores active contacts, writing score history where a score changed.
  • Contacts qualifying for the first time get one mql event and a handoff queued to each lead_handoff connector (a TopoloCRM task when the caller can reach CRM).

Interpret the response

The model version is an integer or null, not a resource identifier. Inspect the model or recompute outcome and discover contacts separately before using contact ids.

Call app_topolo_nurture.scoring_model.get and confirm model.currentVersion increased and hasUnpublishedChanges is false.

Exact success schema:

{
  "type": "object",
  "required": [
    "model",
    "handoff",
    "recompute"
  ],
  "properties": {
    "model": {
      "type": "object",
      "required": [
        "draft",
        "currentVersion",
        "published",
        "hasUnpublishedChanges"
      ],
      "properties": {
        "draft": {
          "type": "object",
          "required": [
            "behaviourRules",
            "fitRules",
            "mqlThreshold"
          ],
          "properties": {
            "behaviourRules": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "fitRules": {
              "type": "array",
              "items": {
                "type": "object"
              }
            },
            "mqlThreshold": {
              "type": "integer"
            }
          }
        },
        "currentVersion": {
          "type": [
            "integer",
            "null"
          ]
        },
        "hasUnpublishedChanges": {
          "type": "boolean"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "updatedBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "published": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "version": {
              "type": "integer"
            },
            "model": {
              "type": "object",
              "required": [
                "behaviourRules",
                "fitRules",
                "mqlThreshold"
              ],
              "properties": {
                "behaviourRules": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                },
                "fitRules": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                },
                "mqlThreshold": {
                  "type": "integer"
                }
              }
            },
            "publishedAt": {
              "type": "string"
            },
            "publishedBy": {
              "type": "string"
            }
          }
        }
      }
    },
    "handoff": {
      "type": "object",
      "required": [
        "connectors",
        "unavailable"
      ],
      "properties": {
        "connectors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "connectorId": {
                "type": "string"
              },
              "provider": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "config": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          }
        },
        "unavailable": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "provider": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "recompute": {
      "type": "object",
      "required": [
        "evaluated",
        "changed",
        "qualified",
        "newlyQualified",
        "truncated"
      ],
      "properties": {
        "evaluated": {
          "type": "integer"
        },
        "changed": {
          "type": "integer"
        },
        "qualified": {
          "type": "integer"
        },
        "newlyQualified": {
          "type": "integer"
        },
        "truncated": {
          "type": "boolean"
        }
      }
    }
  }
}

Worked examples

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Replace synthetic identifiers using credential-scoped discovery. A local success is not evidence of a deployed effect, configured provider or delivered message.

Successful request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_nurture.scoring_model.publish --data @payload.json --json
topolo actions plan app_topolo_nurture.scoring_model.publish --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.scoring_model.publish --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_nurture.scoring_model.publish",
    "input": {},
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 201:

{
  "model": {
    "draft": {
      "behaviourRules": [
        {
          "id": "pricing",
          "eventType": "feature_used",
          "propertyMatch": {
            "key": "feature",
            "value": "pricing"
          },
          "points": 20,
          "halfLifeDays": 7,
          "maxPoints": 60
        },
        {
          "id": "signup",
          "eventType": "signup",
          "points": 5,
          "halfLifeDays": 0
        }
      ],
      "fitRules": [
        {
          "id": "saas",
          "field": "industry",
          "operator": "equals",
          "value": "saas",
          "points": 20
        }
      ],
      "mqlThreshold": 50
    },
    "currentVersion": 1,
    "published": {
      "version": 1,
      "model": {
        "behaviourRules": [
          {
            "id": "pricing",
            "eventType": "feature_used",
            "propertyMatch": {
              "key": "feature",
              "value": "pricing"
            },
            "points": 20,
            "halfLifeDays": 7,
            "maxPoints": 60
          },
          {
            "id": "signup",
            "eventType": "signup",
            "points": 5,
            "halfLifeDays": 0
          }
        ],
        "fitRules": [
          {
            "id": "saas",
            "field": "industry",
            "operator": "equals",
            "value": "saas",
            "points": 20
          }
        ],
        "mqlThreshold": 50
      },
      "publishedAt": "2026-10-04T00:32:36.138Z",
      "publishedBy": "u1"
    },
    "hasUnpublishedChanges": false,
    "updatedAt": "2026-10-04T00:32:36.137Z",
    "updatedBy": "u1"
  },
  "handoff": {
    "connectors": [],
    "unavailable": []
  },
  "recompute": {
    "evaluated": 2,
    "changed": 2,
    "qualified": 0,
    "newlyQualified": 0,
    "truncated": false
  }
}

HTTP 201. Call app_topolo_nurture.scoring_model.get and confirm model.currentVersion increased and hasUnpublishedChanges is false.

Another supported request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_nurture.scoring_model.publish --data @payload.json --json
topolo actions plan app_topolo_nurture.scoring_model.publish --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.scoring_model.publish --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_nurture.scoring_model.publish",
    "input": {},
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 201:

{
  "model": {
    "draft": {
      "behaviourRules": [
        {
          "id": "pricing",
          "eventType": "feature_used",
          "propertyMatch": {
            "key": "feature",
            "value": "pricing"
          },
          "points": 20,
          "halfLifeDays": 7,
          "maxPoints": 60
        },
        {
          "id": "signup",
          "eventType": "signup",
          "points": 5,
          "halfLifeDays": 0
        }
      ],
      "fitRules": [
        {
          "id": "saas",
          "field": "industry",
          "operator": "equals",
          "value": "saas",
          "points": 20
        }
      ],
      "mqlThreshold": 50
    },
    "currentVersion": 1,
    "published": {
      "version": 1,
      "model": {
        "behaviourRules": [
          {
            "id": "pricing",
            "eventType": "feature_used",
            "propertyMatch": {
              "key": "feature",
              "value": "pricing"
            },
            "points": 20,
            "halfLifeDays": 7,
            "maxPoints": 60
          },
          {
            "id": "signup",
            "eventType": "signup",
            "points": 5,
            "halfLifeDays": 0
          }
        ],
        "fitRules": [
          {
            "id": "saas",
            "field": "industry",
            "operator": "equals",
            "value": "saas",
            "points": 20
          }
        ],
        "mqlThreshold": 50
      },
      "publishedAt": "2026-10-04T00:32:36.007Z",
      "publishedBy": "u1"
    },
    "hasUnpublishedChanges": false,
    "updatedAt": "2026-10-04T00:32:36.006Z",
    "updatedBy": "u1"
  },
  "handoff": {
    "connectors": [],
    "unavailable": []
  },
  "recompute": {
    "evaluated": 1,
    "changed": 1,
    "qualified": 0,
    "newlyQualified": 0,
    "truncated": false
  }
}

HTTP 201. Call app_topolo_nurture.scoring_model.get and confirm model.currentVersion increased and hasUnpublishedChanges is false.

Refused request · no_changes

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_nurture.scoring_model.publish --data @payload.json --json
topolo actions plan app_topolo_nurture.scoring_model.publish --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 409:

{
  "error": {
    "code": "no_changes",
    "message": "The draft is identical to the published version."
  }
}

HTTP 409. Preserve the refusal details and do not claim success.

Refused request · model_empty

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_nurture.scoring_model.publish --data @payload.json --json
topolo actions plan app_topolo_nurture.scoring_model.publish --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 422:

{
  "error": {
    "code": "model_empty",
    "message": "Add at least one behaviour or fit rule with scoring_model.update before publishing."
  }
}

HTTP 422. Preserve the refusal details and do not claim success.

Refused request · permission_denied

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_nurture.scoring_model.publish --data @payload.json --json
topolo actions plan app_topolo_nurture.scoring_model.publish --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 403:

{
  "error": {
    "code": "permission_denied",
    "message": "The credential lacks workspace:write.",
    "details": {
      "requiredPermission": "workspace:write"
    }
  }
}

HTTP 403. Preserve the refusal details and do not claim success.

Verify the result

  • Call app_topolo_nurture.scoring_model.get and confirm model.currentVersion increased and hasUnpublishedChanges is false.

Errors and recovery

  • organization_required (HTTP 403): Select an organization available to the verified caller before choosing a Nurture workspace.
  • permission_denied (HTTP 403): Grant the credential the required Nurture workspace permission.
  • workspace_required (HTTP 409): Create a Nurture workspace, or pass the workspace resource context.
  • invalid_input (HTTP 422): Correct the fields named in error.details using inputSchema, then retry.
  • model_empty (HTTP 422): Add a behaviour or fit rule with app_topolo_nurture.scoring_model.update.
  • no_changes (HTTP 409): The draft already equals the published version; change the draft first.

Auth or gateway failures may precede this handler. Preserve the exact response shape, error string/code, request id and credential context; no synthetic fixture establishes live credential access.

Recovery boundary

Send the previous version's model back as the draft and publish again. mql events and CRM tasks already created stay.

  • List qualified leads: List active contacts whose current lead score is at or above the MQL threshold, highest first (up to 500), with email, score breakdown, when they first qualified and each lead handoff's status. This is where qualified leads stay when no lead_handoff connector is enabled; the segment condition lead_score (operator qualified) holds the same set.
  • Recompute lead scores: Rescore one active contact (contactId) or every active contact (up to 5000) against the published model at the current time, then deliver pending lead handoffs this caller can reach (handoffs queued by the scheduled decay pass or a Notify delivery wait for a credentialed call like this one). Safe to repeat: an unchanged score writes no history and each contact qualifies once. The first time a contact qualifies Nurture records one mql lifecycle event (journey trigger and goal, segment event condition) and queues a handoff to every active connector with lead_handoff (TopoloCRM: a follow-up task on the linked CRM contact; TopoloEngage: enrolment into the connector's Engage campaign from its seat, skipped for an archived Engage contact or an address with a hard bounce, complaint or wrong-person block); without one the contact stays in Nurture (scoring.qualified.list, segment condition lead_score).
  • Update lead scoring draft: Replace the draft lead scoring model (behaviourRules, fitRules, mqlThreshold; up to 50 rules each with unique ids). Scores do not change until scoring_model.publish. Score = fit + behaviour. Fit rules add points when a contact field matches (equals, not_equals, contains, exists, not_exists). Behaviour rules add points per matching lifecycle event (optionally only when properties[key] equals a value), each event halving every halfLifeDays (0 = no decay), with the rule clipped to maxPoints. A contact qualifies when score >= mqlThreshold.

Evidence

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Test scenario and capture digests are retained with each fixture.