Crm API
由
scripts/generate-api-docs.ts自动生成 —— 请勿手改 共 12 个端点
DELETE /crm/{organizationId}/contacts/{contactId}
删除联系人(软删除)
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ | |
contactId | path | string | ✅ |
响应
| 状态码 | 说明 |
|---|---|
| 200 |
PATCH /crm/{organizationId}/contacts/{contactId}
更新联系人
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ | |
contactId | path | string | ✅ |
请求体
json
{
"$ref": "#/components/schemas/UpdateContactDto"
}响应
| 状态码 | 说明 |
|---|---|
| 200 |
GET /crm/{organizationId}/customers
客户列表(按组织隔离,支持名称模糊与阶段筛选)
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ | |
q | query | string | — | 按客户名称模糊匹配 |
stage | query | string | — | |
limit | query | string | — | 默认 50,上限 200 |
响应
| 状态码 | 说明 |
|---|---|
| 200 |
POST /crm/{organizationId}/customers
新建客户
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ |
请求体
json
{
"$ref": "#/components/schemas/CreateCustomerDto"
}响应
| 状态码 | 说明 |
|---|---|
| 201 |
DELETE /crm/{organizationId}/customers/{customerId}
归档客户(软删除)
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ | |
customerId | path | string | ✅ |
响应
| 状态码 | 说明 |
|---|---|
| 200 |
GET /crm/{organizationId}/customers/{customerId}
客户详情
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ | |
customerId | path | string | ✅ |
响应
| 状态码 | 说明 |
|---|---|
| 200 |
PATCH /crm/{organizationId}/customers/{customerId}
更新客户
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ | |
customerId | path | string | ✅ |
请求体
json
{
"$ref": "#/components/schemas/UpdateCustomerDto"
}响应
| 状态码 | 说明 |
|---|---|
| 200 |
GET /crm/{organizationId}/customers/{customerId}/contacts
客户下的联系人
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ | |
customerId | path | string | ✅ |
响应
| 状态码 | 说明 |
|---|---|
| 200 |
POST /crm/{organizationId}/customers/{customerId}/contacts
新建联系人
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ | |
customerId | path | string | ✅ |
请求体
json
{
"$ref": "#/components/schemas/CreateContactDto"
}响应
| 状态码 | 说明 |
|---|---|
| 201 |
GET /crm/{organizationId}/opportunities
商机列表(可按客户筛选)
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ | |
customerId | query | string | ✅ |
响应
| 状态码 | 说明 |
|---|---|
| 200 |
POST /crm/{organizationId}/opportunities
新建商机
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ |
请求体
json
{
"$ref": "#/components/schemas/CreateOpportunityDto"
}响应
| 状态码 | 说明 |
|---|---|
| 201 |
PATCH /crm/{organizationId}/opportunities/{opportunityId}
更新商机(阶段推进 / 金额 / 预计成交日)
请求参数
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
organizationId | path | string | ✅ | |
opportunityId | path | string | ✅ |
请求体
json
{
"$ref": "#/components/schemas/UpdateOpportunityDto"
}响应
| 状态码 | 说明 |
|---|---|
| 200 |