---
title: "任务管理 | Tajo"
description: "在 Tajo 的 Brevo CRM 中创建和管理销售任务、跟进事项与活动记录"
url: https://tajo.io/zh-cn/docs/sales-crm/tasks/
markdown: https://tajo.io/zh-cn/docs/sales-crm/tasks.md
lang: zh-CN
author: "Set Noa"
author_url: https://tajo.io/zh-cn/set-noa/
robots: noindex
---

申请抢先体验

请输入您的名字和公司电子邮箱地址。我们会发送确认 Tajo 访问申请的链接。

# 任务管理

[Set Noa](https://tajo.io/zh-cn/set-noa/)

Brevo CRM Tasks API 用于创建和管理销售活动、跟进事项与提醒，让团队在 Tajo 平台内保持井然有序。

## 概览

任务管理在以下场景中不可或缺：

- **销售跟进**，配合自动提醒和截止日期
- **团队协作**，把活动分配给指定的团队成员
- **交易推进**，将任务关联到交易和公司
- **活动跟踪**，监控团队效率与完成率
- **客户互动**，安排忠诚度计划的触达与回访

## 快速开始

### 创建任务

```http
POST https://api.brevo.com/v3/crm/tasks
Content-Type: application/json
api-key: YOUR_API_KEY

{
  "name": "Follow up on Enterprise Loyalty proposal",
  "taskType": "call",
  "date": "2026-02-15T10:00:00Z",
  "duration": 1800,
  "notes": "Discuss volume discount tier and loyalty point allocation",
  "assignTo": "sarah.johnson@tajo.io",
  "companiesIds": ["comp_123456789"],
  "dealsIds": ["deal_abc123def456"],
  "contactsIds": [12345],
  "done": false,
  "reminder": {
    "value": 15,
    "unit": "minutes"
  }
}
```

### 响应

```json
{
  "id": "task_xyz789",
  "name": "Follow up on Enterprise Loyalty proposal",
  "taskType": "call",
  "date": "2026-02-15T10:00:00Z",
  "done": false,
  "created_at": "2026-01-25T14:30:00Z"
}
```

## 获取任务

### 列出全部任务

```http
GET https://api.brevo.com/v3/crm/tasks?limit=50&offset=0&sort=desc
Content-Type: application/json
api-key: YOUR_API_KEY
```

### 响应

```json
{
  "items": [
    {
      "id": "task_xyz789",
      "name": "Follow up on Enterprise Loyalty proposal",
      "taskType": "call",
      "date": "2026-02-15T10:00:00Z",
      "duration": 1800,
      "assignTo": "sarah.johnson@tajo.io",
      "done": false,
      "companiesIds": ["comp_123456789"],
      "dealsIds": ["deal_abc123def456"],
      "created_at": "2026-01-25T14:30:00Z"
    }
  ],
  "total": 1
}
```

### 筛选任务

```http
GET https://api.brevo.com/v3/crm/tasks?filters[done]=false&filters[taskType]=call&sort=date:asc
```

### 获取单个任务

```http
GET https://api.brevo.com/v3/crm/tasks/{task_id}
Content-Type: application/json
api-key: YOUR_API_KEY
```

## 任务类型

CRM 针对不同的销售活动支持多种任务类型：

| 类型 | 说明 | 适用场景 |
| --- | --- | --- |
| `call` | 电话沟通 | 跟进电话、演示、回访 |
| `email` | 邮件触达 | 方案、进展更新、通讯 |
| `meeting` | 线下或线上会议 | 演示、谈判、复盘 |
| `todo` | 通用任务 | 内部工作、调研、准备 |
| `deadline` | 有时限的任务 | 合同续约、里程碑 |

## 自动创建任务

### 基于交易的任务自动化

当交易在各阶段之间推进时自动创建任务：

```javascript
class TaskAutomation {
  constructor() {
    this.tasksApi = new TasksApi();
  }

  async createDealFollowUp(deal, stageChange) {
    const taskTemplates = {
      'Lead': {
        name: `Qualify lead: ${deal.name}`,
        taskType: 'call',
        daysFromNow: 1,
        duration: 900
      },
      'Qualified': {
        name: `Schedule demo: ${deal.name}`,
        taskType: 'meeting',
        daysFromNow: 3,
        duration: 3600
      },
      'Demo': {
        name: `Send proposal: ${deal.name}`,
        taskType: 'email',
        daysFromNow: 1,
        duration: 1800
      },
      'Proposal': {
        name: `Follow up on proposal: ${deal.name}`,
        taskType: 'call',
        daysFromNow: 5,
        duration: 900
      },
      'Negotiation': {
        name: `Finalize contract: ${deal.name}`,
        taskType: 'deadline',
        daysFromNow: 7,
        duration: 3600
      },
      'Closed Won': {
        name: `Onboard customer: ${deal.name}`,
        taskType: 'meeting',
        daysFromNow: 2,
        duration: 3600
      }
    };

    const template = taskTemplates[stageChange.newStage];
    if (!template) return null;

    const taskDate = new Date();
    taskDate.setDate(taskDate.getDate() + template.daysFromNow);

    return await this.tasksApi.createTask({
      name: template.name,
      taskType: template.taskType,
      date: taskDate.toISOString(),
      duration: template.duration,
      assignTo: deal.attributes.deal_owner,
      dealsIds: [deal.id],
      companiesIds: deal.attributes.company_id ? [deal.attributes.company_id] : [],
      contactsIds: deal.attributes.contact_id ? [deal.attributes.contact_id] : [],
      done: false,
      reminder: { value: 30, unit: 'minutes' }
    });
  }

  async createLoyaltyCheckIn(company) {
    return await this.tasksApi.createTask({
      name: `Loyalty program check-in: ${company.name}`,
      taskType: 'call',
      date: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(),
      duration: 1800,
      assignTo: company.attributes.account_manager,
      companiesIds: [company.id],
      notes: `Review tier status: ${company.attributes.loyalty_tier}\nAnnual spend: $${company.attributes.annual_spend}`,
      done: false,
      reminder: { value: 1, unit: 'days' }
    });
  }
}
```

### 批量任务操作

```javascript
class BulkTaskManager {
  async createRenewalTasks(daysBeforeExpiry = 90) {
    const renewalDate = new Date();
    renewalDate.setDate(renewalDate.getDate() + daysBeforeExpiry);

    const companies = await this.companiesApi.getCompanies({
      filters: {
        'attributes.renewal_date': `<${renewalDate.toISOString()}`
      }
    });

    const tasks = [];
    for (const company of companies.items) {
      const task = await this.tasksApi.createTask({
        name: `Contract renewal: ${company.name}`,
        taskType: 'deadline',
        date: company.attributes.renewal_date,
        assignTo: company.attributes.account_manager,
        companiesIds: [company.id],
        notes: `Contract value: $${company.attributes.contract_value}\nCurrent tier: ${company.attributes.loyalty_tier}`,
        done: false,
        reminder: { value: 7, unit: 'days' }
      });
      tasks.push(task);
    }

    return tasks;
  }
}
```

## API 方法参考

```javascript
// Create a new task
const task = await tasksApi.createTask({
  name: 'Follow up call',
  taskType: 'call',
  date: '2026-02-15T10:00:00Z',
  assignTo: 'sales@tajo.io',
  done: false
});

// Get task by ID
const task = await tasksApi.getTask('task_xyz789');

// Update task
await tasksApi.updateTask('task_xyz789', {
  done: true,
  notes: 'Customer agreed to upgrade tier'
});

// Delete task
await tasksApi.deleteTask('task_xyz789');

// List tasks with filtering
const tasks = await tasksApi.getTasks({
  filters: {
    done: false,
    taskType: 'call',
    assignTo: 'sarah@tajo.io'
  },
  sort: 'date:asc',
  limit: 50
});
```

## 最佳实践

1. **自动创建任务**：把任务与交易阶段变化关联，保证跟进的一致性
2. **设置提醒**：对有时限的任务始终配置提醒
3. **关联记录**：把任务与交易、公司和联系人关联，补足上下文
4. **跟踪完成情况**：通过任务完成率洞察团队表现
5. **善用任务类型**：正确分类任务，活动报表才准确

## 错误处理

```javascript
try {
  const task = await tasksApi.createTask(taskData);
  console.log('Task created:', task.id);
} catch (error) {
  if (error.status === 400) {
    console.error('Invalid task data:', error.message);
  } else if (error.status === 404) {
    console.error('Associated deal or contact not found');
  } else {
    console.error('Unexpected error:', error);
  }
}
```

## 后续步骤

- **[公司管理](https://tajo.io/zh-cn/docs/sales-crm/companies)** - 管理企业账户
- **[交易管理](https://tajo.io/zh-cn/docs/sales-crm/deals)** - 跟踪销售管道
- **[备注](https://tajo.io/zh-cn/docs/sales-crm/notes)** - 记录客户沟通内容
- **[文件](https://tajo.io/zh-cn/docs/sales-crm/files)** - 管理交易附件
