Skip to main content
Tasks track action items, follow-ups, and to-dos associated with leads.

Task Structure

interface Task {
  id: string;
  leadId: string | null;     // Optional lead association
  title: string;
  description: string | null;
  status: TaskStatus;
  priority: TaskPriority;
  dueDate: string | null;    // ISO date
  assignee: string | null;   // User ID
  timeLogged: number;        // Minutes
  externalProjectId: string | null;
  createdAt: number;
  createdBy: string;
  updatedAt: number;
}

type TaskStatus =
  | 'backlog'
  | 'todo'
  | 'in_progress'
  | 'done'
  | 'canceled';

type TaskPriority =
  | 'low'
  | 'medium'
  | 'high'
  | 'urgent';

Creating Tasks

Create a task for a lead:
curl -X POST "https://api.adaptengine.com/api/v1/tasks" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "leadId": "lead_abc123",
    "title": "Schedule intro call",
    "description": "Reach out to VP of Development",
    "status": "todo",
    "priority": "high",
    "dueDate": "2024-02-15",
    "assignee": "user_xyz"
  }'

Listing Tasks

Get tasks with filtering:
# All tasks for a lead
curl "https://api.adaptengine.com/api/v1/leads/{leadId}/tasks" \
  -H "Authorization: Bearer YOUR_TOKEN"

# Filter by status
curl "https://api.adaptengine.com/api/v1/tasks?status=todo&status=in_progress" \
  -H "Authorization: Bearer YOUR_TOKEN"

# Filter by assignee
curl "https://api.adaptengine.com/api/v1/tasks?assignee=user_xyz" \
  -H "Authorization: Bearer YOUR_TOKEN"

# Overdue tasks
curl "https://api.adaptengine.com/api/v1/tasks?overdue=true" \
  -H "Authorization: Bearer YOUR_TOKEN"

Updating Tasks

Update task status or details:
curl -X PUT "https://api.adaptengine.com/api/v1/tasks/{taskId}" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "in_progress",
    "timeLogged": 30
  }'

Task Comments

Add comments to tasks:
curl -X POST "https://api.adaptengine.com/api/v1/tasks/{taskId}/comments" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Left voicemail, will follow up tomorrow"
  }'

Comment Structure

interface TaskComment {
  id: string;
  taskId: string;
  content: string;
  authorId: string;
  createdAt: number;
  updatedAt: number | null;
}

Priority Levels

PriorityUse Case
urgentImmediate action required
highImportant, complete soon
mediumStandard priority
lowNice to have, when time permits

Status Workflow

backlog → todo → in_progress → done

                 canceled

Time Tracking

Log time spent on tasks:
curl -X POST "https://api.adaptengine.com/api/v1/tasks/{taskId}/time" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "minutes": 45,
    "notes": "Research and prep"
  }'

API Endpoints

MethodEndpointDescription
GET/api/v1/tasksList all tasks
POST/api/v1/tasksCreate task
GET/api/v1/tasks/{id}Get task
PUT/api/v1/tasks/{id}Update task
DELETE/api/v1/tasks/{id}Delete task
GET/api/v1/tasks/{id}/commentsList comments
POST/api/v1/tasks/{id}/commentsAdd comment
GET/api/v1/leads/{leadId}/tasksTasks for lead