Skip to content

Crm API ​

由 scripts/generate-api-docs.ts 自动生成 —— 请勿手改 共 12 个端点

DELETE /crm/{organizationId}/contacts/{contactId} ​

删除联系人(软删除)

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅
contactIdpathstring✅

响应 ​

状态码说明
200

PATCH /crm/{organizationId}/contacts/{contactId} ​

更新联系人

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅
contactIdpathstring✅

请求体 ​

json
{
  "$ref": "#/components/schemas/UpdateContactDto"
}

响应 ​

状态码说明
200

GET /crm/{organizationId}/customers ​

客户列表(按组织隔离,支持名称模糊与阶段筛选)

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅
qquerystring—按客户名称模糊匹配
stagequerystring—
limitquerystring—默认 50,上限 200

响应 ​

状态码说明
200

POST /crm/{organizationId}/customers ​

新建客户

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅

请求体 ​

json
{
  "$ref": "#/components/schemas/CreateCustomerDto"
}

响应 ​

状态码说明
201

DELETE /crm/{organizationId}/customers/{customerId} ​

归档客户(软删除)

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅
customerIdpathstring✅

响应 ​

状态码说明
200

GET /crm/{organizationId}/customers/{customerId} ​

客户详情

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅
customerIdpathstring✅

响应 ​

状态码说明
200

PATCH /crm/{organizationId}/customers/{customerId} ​

更新客户

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅
customerIdpathstring✅

请求体 ​

json
{
  "$ref": "#/components/schemas/UpdateCustomerDto"
}

响应 ​

状态码说明
200

GET /crm/{organizationId}/customers/{customerId}/contacts ​

客户下的联系人

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅
customerIdpathstring✅

响应 ​

状态码说明
200

POST /crm/{organizationId}/customers/{customerId}/contacts ​

新建联系人

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅
customerIdpathstring✅

请求体 ​

json
{
  "$ref": "#/components/schemas/CreateContactDto"
}

响应 ​

状态码说明
201

GET /crm/{organizationId}/opportunities ​

商机列表(可按客户筛选)

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅
customerIdquerystring✅

响应 ​

状态码说明
200

POST /crm/{organizationId}/opportunities ​

新建商机

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅

请求体 ​

json
{
  "$ref": "#/components/schemas/CreateOpportunityDto"
}

响应 ​

状态码说明
201

PATCH /crm/{organizationId}/opportunities/{opportunityId} ​

更新商机(阶段推进 / 金额 / 预计成交日)

请求参数 ​

参数名位置类型必填说明
organizationIdpathstring✅
opportunityIdpathstring✅

请求体 ​

json
{
  "$ref": "#/components/schemas/UpdateOpportunityDto"
}

响应 ​

状态码说明
200

Released under the MIT License.