Skip to content

Lead methods: update, delete

The Lead Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for Lead, one group of Lead methods.

Lead.update

Changes the given properties of a Lead. Verb page.

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

Emits Lead.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Lead.
emailemailThe primary email address.
phonestringThe primary phone number.
namestringThe name the Contact goes by.
interesttextWhat the Lead asked for.
ownerWorkerThe Worker who answers it.

Returns

OutputTypeRequiredDescription
leadLeadrequiredThe Lead.

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.update({ id: 'lead_Kz1R9fhqzZ', owner: 'worker_whZFpOKWIV' })

Lead.delete

Deletes a Lead: a soft delete that keeps its history, undone by Thing.restore. Verb page.

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

Emits Lead.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Lead.

Returns

OutputTypeRequiredDescription
leadLeadrequiredThe Lead.

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.delete({ id: 'lead_Kz1R9fhqzZ' })