Qualify lead
Code Mode: praxis.crm.leads.qualify
HTTP: POST /crm/v1/leads/{leadId}:qualify
Qualify a lead with explicit contact, company and optional deal choices in one operation. Unlike HubSpot, CRM exposes these decisions as a single action because qualification coordinates several related record edits rather than editing only the lead stage. Obtain leadId from objects.list for leads and qualifiedStageId from its pipeline; choose a won stage and satisfy its required properties. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
签名
praxis.crm.leads.qualify(args:{path:{leadId:string};body:{/** Keep the existing contact, or merge it into the chosen contact record. */ contact:{/** keep retains the lead contact without merging. e.g. "keep" */ kind:"keep"}|{/** merge moves the lead contact into intoId. e.g. "merge" */ kind:"merge";/** Destination contact record id from objects.list or objects.search for contacts. */ intoId:string};/** Leave company unchanged, associate an existing company, or create one with explicit properties. */ company:{/** none does not add a company association. e.g. "none" */ kind:"none"}|{/** associate links the contact to companyId. e.g. "associate" */ kind:"associate";/** Existing company record id from objects.list or objects.search for companies. */ companyId:string}|{/** create makes a company using properties. e.g. "create" */ kind:"create";/** Initial values of the company to create; use property names from properties.list. */ properties:{[key:string]:string|null}};/** Optional deal to create as part of qualification; omit to qualify without creating a deal. */ deal?:{/** Deal pipeline id from pipelines.list for deals. */ pipelineId:string;/** Initial deal stage id from that pipeline; its required properties must be provided. */ stageId:string;/** Initial deal property values; satisfy the chosen stage requirements. */ properties:{[key:string]:string|null}};/** Lead stage id with praxis_category=won, obtained from the leads pipeline. */ qualifiedStageId:string}}):Promise<({/** Affected record references for rendering entity cards in conversations; may be empty for definition-only writes. */ refs:Array<{/** Object type containing the referenced record; use with objects.retrieve. e.g. "deals" */ object:string;/** Record identifier to retrieve with object; obtained from the write result. e.g. "rec_example" */ id:string;/** Console URL for opening the entity card in a conversation or viewing the record. e.g. "https://console.deepraxis.com/crm/deals/rec_example" */ viewer_url:string;/** Optional property changes to render alongside the entity card. */ changes?:Array<{/** Internal name of the property changed by this request. */ property:string;/** Value before the change; null means the property was empty. */ before:string|null;/** Value committed by the change; null means the property was cleared. */ after:string|null}>}>})&({/** Affected record references for rendering entity cards in conversations; may be empty for definition-only writes. */ refs:Array<{/** Object type containing the referenced record; use with objects.retrieve. e.g. "deals" */ object:string;/** Record identifier to retrieve with object; obtained from the write result. e.g. "rec_example" */ id:string;/** Console URL for opening the entity card in a conversation or viewing the record. e.g. "https://console.deepraxis.com/crm/deals/rec_example" */ viewer_url:string;/** Optional property changes to render alongside the entity card. */ changes?:Array<{/** Internal name of the property changed by this request. */ property:string;/** Value before the change; null means the property was empty. */ before:string|null;/** Value committed by the change; null means the property was cleared. */ after:string|null}>}>})>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| leadId | path | string | 是 | Lead record identifier from objects.list or objects.search with objectType=leads. |
请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json | Contact, company and optional deal decisions, plus the qualified lead stage id. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | Qualify lead succeeded; inspect the returned resource or result collection. |
| 400 | application/json | VALIDATION_ERROR rejects invalid properties or stage rules; supply errors[0].context.properties when requirements are missing, or choose an allowed stage. BAD_REQUEST rejects malformed input; correct the request before retrying. |
| 401 | application/json | The bearer credential is missing or invalid; provide a valid platform API key before retrying. |
| 404 | application/json | OBJECT_NOT_FOUND means an object type, record or definition is unavailable in your organization; select an accessible identifier from its list operation. |
| 409 | application/json | CONFLICT means a unique value is already used or a change-set reversal would overwrite a later value; read the current records and resolve the conflicting values before retrying. |