Skip to content

Lead methods: assign, convert, disqualify

The Lead Verbs assign, convert, disqualify as typed SDK methods, with inputs, result, refusals and an example.

Reference for Lead, one group of Lead methods.

Lead.assign

Assign gives a Lead one owner Worker, by round robin, territory or ICP fit, as the Startup’s routing Policy says. Verb page.

TypeScript
interface LeadVerbs {
  assign(input: LeadAssignInput, options?: SB.CallOptions): SB.Call<Lead>
}

Emits Lead.assigned.

Inputs

InputTypeRequiredDescription
leadLeadrequiredThe Lead to route.
ownerWorkerThe Worker to own it; omitted, the routing Policy picks.

Returns

OutputTypeRequiredDescription
leadLeadrequiredThe Lead, with its owner.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const lead = await $.Lead.assign({ lead: 'lead_Kz1R9fhqzZ' })

Lead.convert

Convert ends a qualified Lead’s pursuit as a Lead: it opens a Deal or routes the Lead to self-serve checkout. Verb page.

TypeScript
interface LeadVerbs {
  convert(input: LeadConvertInput, options?: SB.CallOptions): SB.Call<LeadConvertOutput>
}

Emits Lead.converted.

Inputs

InputTypeRequiredDescription
leadLeadrequiredThe qualified Lead.
offerOfferrequiredThe Offer the Deal pursues, or the checkout sells.
routestringrequiredWhere the Lead goes: deal for an assisted sale or checkout for self-serve.

Returns

OutputTypeRequiredDescription
dealDealThe opened Deal, when the route is deal.
leadLeadrequiredThe Lead, now converted.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const { deal, lead } = await $.Lead.convert({ lead: 'lead_Kz1R9fhqzZ', offer: 'offer_2hzYe1ERo0', route: 'Example route' })

Lead.disqualify

Disqualify ends a Lead’s pursuit because it fits no Offer, with the reason; its Contact record and Consent stay. Verb page.

TypeScript
interface LeadVerbs {
  disqualify(input: LeadDisqualifyInput, options?: SB.CallOptions): SB.Call<Lead>
}

Emits Lead.disqualified.

Inputs

InputTypeRequiredDescription
leadLeadrequiredThe Lead to disqualify.
reasonstringrequiredWhy it fits no Offer.

Returns

OutputTypeRequiredDescription
leadLeadrequiredThe Lead, now disqualified.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const lead = await $.Lead.disqualify({ lead: 'lead_Kz1R9fhqzZ', reason: 'noFit' })