Nurture
131 published documents
-
List journey versions
List the immutable published versions of a journey, newest first, with each version's full definition.
-
List journeys
List the journeys in the caller's Nurture workspace, newest change first, optionally filtered by status (draft = never published, published = has a live version, archived).
-
List lifecycle events
List the newest lifecycle events in the workspace, optionally filtered by event type or contact, up to 200.
-
List Notify source adapters
List the fixed, versioned adapters from TopoloNotify event types (published @topolo-io/notifications taxonomy) to Nurture lifecycle event types for Auth, Forms, Pay, Commerce and Engage, plus Nexus nexus.email.* delivery events (lifecycleEventType nexus_email_delivery: applied to the matching send as delivery engagement and suppressions, not ingested as lifecycle events). Available entries can be connected; unavailable entries name the missing published contract and the events.ingest fallback.
-
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.
-
List segment members
List the contacts currently in a segment as of its last recompute, newest entries first.
-
List segments
List the segments in the caller's Nurture workspace, optionally filtered by status. A segment is a rule set over contact fields (Nurture contacts, or the linked CRM workspace), Nurture lifecycle events and the lead score (kind lead_score: operator qualified, or at_least with a value).
-
List signup forms
List the signup forms in the caller's Nurture workspace, optionally filtered by status. Each form is a public hosted page (hostedUrl, embeddable with embedHtml; null until NURTURE_PUBLIC_URL is configured) for one subscription topic. A submission creates or reuses the contact (source signup) and always starts double opt-in; it never subscribes directly. The confirmation email goes out through Nexus email.send from the workspace's verified sender (sending_settings.get); it waits in the outbox when no Nexus credential is usable.
-
List subscription topics
List the subscription topics in the caller's Nurture workspace, optionally filtered by status. Topics are what a contact can subscribe to in the preference centre; the contact's choice itself is held by TopoloConsent.
-
Migrate enrollments to live version
Explicitly move active enrollments from an older version (fromVersion) to the journey's live version, up to 500 per call (more true means call again). Safe rule: an enrollment moves only when the node it stands on exists in the live version with the same id and kind; it then continues from that node. Others stay pinned and are listed in skipped[] with a reason. dryRun true reports without changing anything.
-
Preview email template
Render a saved template version (templateId, version?) or an unsaved draft to email-safe HTML (tables, inline styles, dark-mode and mobile rules) plus the auto-generated plain-text alternative, for an optional sample contact. Brand name, email logo, light and dark accent colours, footer, legal entity, postal address and unsubscribe wording come from the workspace TopoloBrand kit when one is bound and readable, else the workspace template brand settings, else neutral defaults; Brand being unavailable never fails a preview. Unsubscribe and preference links are inert placeholders (#unsubscribe, #preferences); a real send substitutes signed recipient links. No side effects: nothing is saved or sent.
-
Promote experiment winner
Make one arm the winner. It must be results.recommendedWinner (significant at 95%) unless override is true with an overrideReason; the override, reason and acting user are recorded. Broadcast with testPercent: the winner is queued for every remaining contact and the broadcast resumes sending (it must be sending or sent). Journey: the draft's split node is set to 100% winner (other arms weight 0, no holdout); publish the journey to make it live, as published versions never change. The experiment ends as promoted.
-
Publish journey version
Freeze the current draft as the next immutable version and make it live: new trigger matches and manual enrollments use it from now on. Existing enrollments stay pinned to the version they entered on. Refused when the draft is invalid or unchanged since the last publish.
-
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).
-
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).
-
Recompute segment membership
Re-evaluate one segment and record who entered and who exited. It always evaluates the workspace's own active Nurture contacts (fields email, first_name, last_name, locale, timezone, source and every attribute key), including contacts a connector synced in with connectors.sync; it never reads a remote system. Recent lifecycle events are joined by contact id.
-
Reconcile delivery status
The fallback for workspaces without every Nexus delivery event connected: poll app_topolo_nexus.email.messages.get, as the caller, for recent sends (days 1-30, default 7; limit 1-100, default 50) whose final state is unknown. Delivered, bounced and complained become report engagement; hard bounces and complaints are added to the suppression ledger. When sending_settings.get shows deliveryEvents.mode events it polls nothing and returns skipped 1. Outcomes seen by both paths are recorded once.
-
Record suppression event
Append one event to the contact's suppression ledger. Blocking events: unsubscribed (all marketing, or one topic with topicKey), hard_bounce, complaint, wrong_person (these three apply org-wide to the address), reply_stop, not_interested (outreach), manual_block (everything). Loosening events need evidence: deliverable (clears hard_bounce) needs verification; repermissioned (clears unsubscribed, reply_stop, not_interested) needs consent_decision, and clearing a complaint also needs verification; manual_unblock (clears manual_block) is an operator action. import_attestation never lifts a block. double_opt_in evidence cannot be sent here; it is produced only by the public confirmation link.
-
Regenerate AI draft
Generate a proposed draft again from its stored inputs and the current Brand voice, optionally guided by reviewer feedback. The output, findings and provenance are replaced and attempt increases. Only proposed drafts can be regenerated; nothing is applied.
-
Reject AI draft
Reject a proposed draft as the calling person, with an optional note. Nothing is applied; the draft is kept for audit.
-
Reject broadcast
Return a broadcast that is awaiting approval, or already approved but not yet scheduled, to draft with a reason. The approval and submission are cleared, so it must be submitted and approved again.
-
Release a send reservation
Release an unused reservation so it stops counting toward the contact's caps. Releasing a reservation that is already released or consumed changes nothing. A remote reservation taken through a connector is released there too (remote[]).
-
Request double opt-in confirmation
Start double opt-in for a contact and an active topic: records subscribe_requested (state pending_confirmation) and returns confirmationUrl, a signed single-use link valid for 7 days (only its hash is stored). Opening the link (GET) only shows a page with a Confirm subscription button and never changes state, so email link scanners cannot confirm; the button POSTs the token, which confirms the subscription with double_opt_in evidence. With a verified sender (sending_settings) Nurture emails the link through Nexus (transactional, service_notice) and reports it in email; without one email.status is not_configured: deliver confirmationUrl yourself. Never confirm on the contact's behalf.
-
Reserve a send slot
Check eligibility for one contact and, when eligible, atomically reserve a send slot that counts toward the caps for 15 minutes (or until released). Idempotent by idempotencyKey: a repeat returns the same live reservation without re-counting caps, or granted false with reservation_expired once released or expired. Applies the same suppression, subscription and pacing rules as app_topolo_nurture.eligibility.check; transactional messages need messageCategory. For marketing and outreach a granted reservation includes listUnsubscribe: a signed one-click unsubscribe URL and POST body for the message body. Nexus owns the List-Unsubscribe headers; pass the preference centre to email.send as unsubscribe_landing_url. With an active suppression_sync connector, a connector-sourced contact is also reserved in that system (TopoloCRM eligibility.reserve) and the stricter answer wins: a remote refusal releases the Nurture reservation and returns its reasons. Sends nothing.
-
Schedule broadcast
Queue an approved broadcast. The scheduler (every 5 minutes) launches it at its launch time: now, sendAt, or for recipient_local the moment the local time first occurs anywhere (UTC+14). Launch snapshots the active contacts in its segments; recompute segments beforehand for fresh membership. Recipients are then sent in throttled batches. Each recipient goes through eligibility.reserve (subscription to the topic, suppressions, caps, quiet hours) with key broadcast:{id}:{contactId}; a granted reservation is consumed once and recorded as sent_intended. With a verified sender (sending_settings.get) the send goes out through Nexus email.send, or waits in the outbox when no Nexus credential is usable; with no sender configured it is only recorded.
-
Set the inactivity policy
Enable or disable the derived inactive event and set its window (1-365 days). When enabled, the Nurture scheduler records one inactive event per contact whose newest lifecycle event is older than the window, once per stretch of inactivity, and runs journey triggers for it.
-
Simulate journey
Walk the draft (or a published version) for one real contact (contactId) or an inline sample { fields, timezone, events[], segmentIds[] } on a simulated clock from startAt (default now), jumping over delays, and return the path with timings. Side-effect free: nothing is enrolled, reserved or recorded; for a real contact each send asks eligibility.check what would happen at that simulated time (intended, deferred, blocked). Stops at exit, goal conversion or maxSteps (truncated true).
-
Stop experiment
Stop an active experiment without a winner. A broadcast experiment stopped before launch is ignored at launch; after launch, recipients already queued are still sent and the untested remainder is never sent. A journey keeps splitting by the node weights but stops recording assignments.
-
Submit broadcast for approval
Submit a draft for approval. Checks that the topic and every segment are active, the schedule is still ahead, and the template renders without errors; pins the template version (the given one, else the current one) so the approver reviews exactly what will be sent. The submitter is recorded and cannot approve it.
-
Subscribe contact with evidence
Subscribe a contact to an active topic on the strength of evidence. consent_decision (provider, decisionRef, purposeId) always subscribes, also after an unsubscribe. import_attestation (importId, lawfulBasis; attestedBy is the caller) is accepted only as the contact's very first subscription to the topic, never after an unsubscribe, and never for a topic with doubleOptIn true. For double opt-in use subscriptions.request_confirmation instead; double_opt_in evidence is only ever produced by the public confirmation link. Marketing delivered through Nexus is attested to Nexus from the latest double opt-in, repermission or consent_decision record; an import_attestation alone is not consent and the send skips with no_consent_evidence.
-
Sync a connector
Run one bounded sync as the caller: with contact_source, page the remote contacts (up to 50 pages, resuming from lastSyncCursor) and upsert them into Nurture contacts; with suppression_sync, push pending blocking ledger events for connector-sourced contacts. A sync only writes contact profiles: it never changes an unsubscribe or suppression, never unarchives a contact, and never takes over an address Nurture already holds from another source (counted as skipped). Safe to repeat.
-
Test send broadcast
Render the broadcast's template (pinned version, else current) for up to 5 named addresses, merged with sampleContactId when given, and record a test send labelled "[Test]" in the subject. It bypasses the audience and eligibility and is allowed in any status but archived. With a verified sender (sending_settings) each address gets one email through Nexus email.send as the caller (transactional class, idempotent per address); deliveries[] reports sent with the Nexus message id, or not_sent with a reason. The rendered html and text are returned for review.
-
Unsubscribe contact from topic
Unsubscribe a contact from one topic (active or archived) by appending a topic-scoped unsubscribed event to the suppression ledger, the single source of unsubscribes. Marketing for that topic is blocked until the contact re-subscribes with double opt-in or a consent decision.
-
Update a connector
Change a connector's capabilities, config, or status (active or paused). A paused connector keeps its settings but neither syncs nor takes part in eligibility or lead handoff. Only the fields sent change; config is replaced whole, so send every field. A topolo_engage campaignId and seatId are checked in Engage as the caller. Use connectors.disconnect to disconnect.
-
Update AI drafting settings
Set whether AI drafts need a second person: with requireSecondApprover true, the requester of a draft cannot approve it.
-
Update attribution settings
Change how conversions are credited: goalEventTypes (1-10 lifecycle event types, e.g. purchase, subscription_changed, mql), windowDays (1-90) and basis (send or click). Only the fields sent change. Reports are computed on read, so every report, past periods included, uses the new settings immediately; nothing stored is rewritten.
-
Update broadcast draft
Change a draft broadcast's name, template, pinned templateVersion (null = current version at submit), topic, segments, schedule or throttlePerHour (null = unthrottled). Only drafts can change; reject a pending or approved broadcast back to draft first. Changing templateId clears the pinned version unless one is given. schedule is {mode:"now"} (default), {mode:"at", sendAt ISO-8601} or {mode:"recipient_local", date YYYY-MM-DD, time HH:MM, fallbackTimezone IANA}: recipient_local sends at that wall-clock time in each contact's own zone, using fallbackTimezone when the contact has none.
-
Update contact
Change an active contact's email, names, locale, timezone or attributes. Only the fields sent change; attributes, when sent, replace the whole map; null clears a name, locale or timezone.
-
Update email template
Change a template. Renaming changes it in place; any subject, preheader or blocks change appends a new immutable version and makes it current, so earlier versions stay readable. blocks is an ordered list of typed blocks: heading {text, level 1-3}, text {text with **bold**, _italic_ and [label](https://…) only}, image {src https, alt, width?, href?}, button {label, href https or mailto}, divider, spacer {height}, columns {2-3 columns of the other leaf blocks}, and exactly one footer {text?} as the LAST block, which always renders the unsubscribe and preference links plus the brand footer and postal address. Raw HTML is never accepted; every value is escaped. Merge tags {{contact.firstName|fallback}}, {{contact.lastName}} and {{contact.email}} are allowed in the subject, preheader and text.
-
Update journey draft
Change a journey's name, description or draft definition. Editing a published journey creates a new draft (hasUnpublishedChanges true); the live version and every in-flight enrollment keep running unchanged until app_topolo_nurture.journeys.publish and an explicit app_topolo_nurture.journeys.enrollments.migrate. Returns problems[] for the saved draft.