跳转到内容
EN

Archive pipeline

Code Mode: praxis.crm.pipelines.archive

HTTP: DELETE /crm/v1/pipelines/{objectType}/{pipelineId}

Archive a pipeline selected from pipelines.list when records no longer depend on it. Check current records and stage usage first; resolve references reported by validation before retrying. Stage rules are string values in stage.metadata: praxis_category is open (active), won (successful) or lost (unsuccessful); praxis_terminal is “true” (no further transition) or “false” (transitions allowed); praxis_allowed_next is a JSON-encoded array string of permitted next stage ids, with the string “null” meaning unrestricted; praxis_required is a JSON-encoded array string of property names (”[]” means none) that must be non-empty on entry (boolean properties must be “true”). Rule violations return HTTP 400 VALIDATION_ERROR; errors[0].context.properties lists missing required property names. Correct those values or choose an allowed stage before retrying. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations. Unlike HubSpot, this own-face archive returns HTTP 200 with a JSON refs body instead of HTTP 204. Example metadata: {“praxis_category”:“open”,“praxis_terminal”:“false”,“praxis_allowed_next”:”[“proposal”,“lost”]”,“praxis_required”:”[“budget”,“decision_maker”]”}.

签名

praxis.crm.pipelines.archive(args:{path:{objectType:string;pipelineId:string};query?:{validateDealStageUsagesBeforeDelete?:boolean;validateReferencesBeforeDelete?:boolean}}):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}>}>}>;

参数

名称位置类型必填说明
objectTypepathstring是Object type name from schemas.list, such as contacts, companies, deals or a custom p_<name>.
pipelineIdpathstring是Pipeline identifier from pipelines.list for this objectType.
validateDealStageUsagesBeforeDeletequeryboolean否A boolean indicating whether to validate deal stage usages before deleting the pipeline. Defaults to true.
validateReferencesBeforeDeletequeryboolean否A boolean indicating whether to validate references before deleting the pipeline. Defaults to true.

响应

状态码内容类型说明
200application/jsonWrite completed; refs supports entity cards in conversations.
400application/jsonVALIDATION_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.
401application/jsonThe bearer credential is missing or invalid; provide a valid platform API key before retrying.
404application/jsonOBJECT_NOT_FOUND means an object type, record or definition is unavailable in your organization; select an accessible identifier from its list operation.
409application/jsonCONFLICT 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.