Skip to content

Tasks API Documentation

The Tasks API provides comprehensive task management capabilities for tracking customer interactions, follow-ups, support requests, and team workflows.

Base URL

https://api.talkingshops.com/v1

Authentication

All API requests require authentication using an API key. Include your API key in the request header:

x-tenant-api-key: your_api_key_here

API keys are tenant-specific and automatically provide access to the correct data for your business account.

Rate Limiting

The API implements rate limiting to prevent abuse. Each tenant is limited to requests per minute based on their subscription tier.


Endpoints Overview

MethodEndpointDescription
POST/tasksCreate a new task
GET/tasksList tasks with filtering and pagination
GET/tasks/:taskIdGet task by ID
PUT/tasks/:taskIdUpdate a task
PATCH/tasks/:taskIdPartial update a task
POST/tasks/:taskId/completeMark task as completed
POST/tasks/:taskId/reassignReassign task to another owner
POST/tasks/:taskId/snoozeSnooze a task
DELETE/tasks/:taskIdDelete a task
GET/tasks/statsGet task statistics
GET/tasks/analyticsGet task analytics
GET/tasks/customer/:customerIdGet tasks for a specific customer

Task Types

Task Status

StatusDescription
not_startedTask has not been started
in_progressTask is currently being worked on
pendingTask is waiting on external action
completedTask has been completed
deferredTask has been deferred

Task Priority

PriorityDescription
lowLow priority task
normalNormal priority task
highHigh priority task
urgentUrgent task requiring immediate attention

Task Title Types

TypeDescription
followupFollow-up with customer
callbackReturn call to customer
meetingSchedule or conduct meeting
supportSupport request
otherOther task type

Task Outcomes

OutcomeDescription
resolvedTask was successfully resolved
no_answerCould not reach customer
callback_scheduledCallback was scheduled
escalatedTask was escalated
auto_completedTask was auto-completed
otherOther outcome

Create Task

Create a new task.

Request

http
POST /v1/tasks
Content-Type: application/json
x-tenant-api-key: your_api_key_here

{
  "title": "Follow up with customer",
  "titleType": "followup",
  "description": "Customer inquired about order #12345",
  "priority": "high",
  "dueDate": "2026-04-15T10:00:00Z",
  "ownerId": "agent_001",
  "ownerName": "John Doe",
  "relatedCustomerId": "cust_123",
  "relatedCustomerName": "Jane Smith",
  "tags": ["followup", "urgent"],
  "metadata": {
    "orderId": "ord_12345"
  }
}

Request Body

FieldTypeRequiredDescription
titlestringYesTask title (max 500 characters)
titleTypestringNoType of task (followup, callback, meeting, support, other)
descriptionstringNoTask description (max 5000 characters)
prioritystringNoPriority level (low, normal, high, urgent)
dueDatestringNoISO 8601 date string for task due date
ownerIdstringNoID of the agent assigned to the task
ownerNamestringNoName of the agent assigned
queueIdstringNoQueue ID if task should be queued
relatedCustomerIdstringNoLinked customer ID
relatedCustomerNamestringNoLinked customer name
relatedConversationIdstringNoLinked conversation ID
tagsarrayNoTask tags (max 20 tags, each max 50 chars)
metadataobjectNoAdditional metadata (max 50 keys)

Response

json
{
  "success": true,
  "message": "Task created successfully",
  "task": {
    "_id": "507f1f77bcf86cd799439011",
    "title": "Follow up with customer",
    "titleType": "followup",
    "description": "Customer inquired about order #12345",
    "status": "not_started",
    "priority": "high",
    "outcome": null,
    "dueDate": "2026-04-15T10:00:00Z",
    "completedAt": null,
    "ownerId": "agent_001",
    "ownerName": "John Doe",
    "queueId": null,
    "claimStatus": "claimed",
    "claimedAt": "2026-04-10T12:00:00Z",
    "claimedBy": "agent_001",
    "relatedCustomerId": "cust_123",
    "relatedCustomerName": "Jane Smith",
    "relatedConversationId": null,
    "collaboratorIds": [],
    "completionNotes": null,
    "tags": ["followup", "urgent"],
    "metadata": { "orderId": "ord_12345" },
    "linkedEntity": null,
    "autoComplete": null,
    "agentReminders": null,
    "snoozedUntil": null,
    "snoozeCount": 0,
    "created_at": "2026-04-10T12:00:00Z",
    "updated_at": "2026-04-10T12:00:00Z"
  }
}

Task Object Fields

FieldTypeDescription
_idstringUnique task identifier
titlestringTask title
titleTypestringType of task (followup, callback, meeting, support, other)
descriptionstringTask description
statusstringTask status
prioritystringPriority level (low, normal, high, urgent)
outcomestring | nullOutcome if completed
dueDatestring | nullDue date (ISO 8601)
completedAtstring | nullCompletion timestamp
ownerIdstringAssigned agent ID
ownerNamestringAssigned agent name
queueIdstring | nullQueue ID if task is queued
claimStatusstringClaim status (unassigned, queued, claimed)
claimedAtstring | nullWhen task was claimed
claimedBystring | nullWho claimed the task
relatedCustomerIdstring | nullLinked customer ID
relatedCustomerNamestringLinked customer name
relatedConversationIdstring | nullLinked conversation ID
collaboratorIdsarrayIDs of collaborators
completionNotesstring | nullNotes from completion
tagsarrayTask tags
metadataobjectCustom metadata
linkedEntityobject | nullLinked pipeline entity
autoCompleteobject | nullAuto-complete configuration
agentRemindersobject | nullAgent reminder settings
snoozedUntilstring | nullSnooze deadline
snoozeCountnumberNumber of times snoozed
created_atstringCreation timestamp (ISO 8601)
updated_atstringLast update timestamp (ISO 8601)

Error Response

json
{
  "error": {
    "code": "ValidationError",
    "message": "Validation failed",
    "details": ["title must be at least 1 characters"]
  }
}

List Tasks

Retrieve a paginated list of tasks with filtering.

Request

http
GET /v1/tasks?status=in_progress&priority=high&limit=20&page=1
x-tenant-api-key: your_api_key_here

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number
limitnumber20Items per page (max 100)
sortstringdueDateSort field
sortDirectionstringascSort direction (asc, desc)
ownerIdstring-Filter by owner
queueIdstring-Filter by queue
statusstring-Filter by status
prioritystring-Filter by priority
relatedCustomerIdstring-Filter by customer
linkedEntityTypestring-Filter by linked entity type
linkedEntityIdstring-Filter by linked entity ID
linkedPipelineIdstring-Filter by linked pipeline
dueBeforestring-Filter by due date before (ISO 8601)
dueAfterstring-Filter by due date after (ISO 8601)
overdueboolean-Filter only overdue tasks
searchstring-Search in title and description

Response

json
{
  "tasks": [
    {
      "_id": "507f1f77bcf86cd799439011",
      "title": "Follow up with customer",
      "titleType": "followup",
      "status": "in_progress",
      "priority": "high",
      "dueDate": "2026-04-15T10:00:00Z",
      "ownerId": "agent_001",
      "ownerName": "John Doe",
      "claimStatus": "claimed",
      "created_at": "2026-04-10T12:00:00Z",
      "updated_at": "2026-04-10T12:00:00Z"
    }
  ],
  "total": 150,
  "page": 1,
  "limit": 20,
  "totalPages": 8
}

Each task in the array contains the same fields as returned by the Create Task endpoint (see Task Object Fields above).


Get Task by ID

Retrieve a single task by its ID.

Request

http
GET /v1/tasks/:taskId
x-tenant-api-key: your_api_key_here

Response

json
{
  "_id": "507f1f77bcf86cd799439011",
  "title": "Follow up with customer",
  "status": "in_progress",
  "priority": "high",
  "ownerId": "agent_001",
  "ownerName": "John Doe",
  ...
}

Error Response

json
{
  "error": {
    "code": "NotFoundError",
    "message": "Task not found"
  }
}

Update Task

Update an existing task.

Request

http
PUT /v1/tasks/:taskId
Content-Type: application/json
x-tenant-api-key: your_api_key_here

{
  "title": "Updated title",
  "description": "Updated description",
  "priority": "urgent",
  "status": "in_progress"
}

Response

json
{
  "success": true,
  "message": "Task updated successfully"
}

Complete Task

Mark a task as completed.

Request

http
POST /v1/tasks/:taskId/complete
Content-Type: application/json
x-tenant-api-key: your_api_key_here

{
  "outcome": "resolved",
  "completionNotes": "Customer satisfied with resolution"
}

Request Body

FieldTypeRequiredDescription
outcomestringNoOutcome of completion
completionNotesstringNoNotes about completion (max 2000 chars)

Response

json
{
  "success": true,
  "message": "Task completed successfully"
}

Error Responses

  • 404 Not Found - Task does not exist
  • 400 Bad Request - Task is already completed or deferred

Snooze Task

Postpone a task by updating its due date.

Request

http
POST /v1/tasks/:taskId/snooze
Content-Type: application/json
x-tenant-api-key: your_api_key_here

{
  "newDueDate": "2026-04-16T10:00:00Z",
  "adjustReminders": true
}

Request Body

FieldTypeRequiredDescription
newDueDatestringYesNew due date (ISO 8601)
adjustRemindersbooleanNoReset reminder timings (default: true)

Response

json
{
  "success": true,
  "message": "Task snoozed successfully",
  "snoozeCount": 2
}

Reassign Task

Transfer task ownership to another agent.

Request

http
POST /v1/tasks/:taskId/reassign
Content-Type: application/json
x-tenant-api-key: your_api_key_here

{
  "newOwnerId": "agent_002",
  "newOwnerName": "Jane Smith"
}

Request Body

FieldTypeRequiredDescription
newOwnerIdstringYesID of new owner
newOwnerNamestringNoName of new owner

Delete Task

Delete a task permanently.

Request

http
DELETE /v1/tasks/:taskId
x-tenant-api-key: your_api_key_here

Response

json
{
  "success": true,
  "message": "Task deleted successfully"
}

Get Task Statistics

Get aggregated task statistics.

Request

http
GET /v1/tasks/stats?ownerId=agent_001
x-tenant-api-key: your_api_key_here

Query Parameters

ParameterTypeDescription
ownerIdstringFilter stats by owner

Response

json
{
  "total": 45,
  "overdue": 5,
  "dueToday": 8,
  "completedThisWeek": 12,
  "inProgress": 20
}

Get Task Analytics

Get comprehensive task analytics with distributions and agent performance.

Request

http
GET /v1/tasks/analytics?startDate=2026-04-01&endDate=2026-04-30
x-tenant-api-key: your_api_key_here

Query Parameters

ParameterTypeDescription
startDatestringStart date filter (ISO 8601)
endDatestringEnd date filter (ISO 8601)
ownerIdstringFilter by owner

Response

json
{
  "totalTasks": 150,
  "completedTasks": 120,
  "overdueTasks": 5,
  "avgCompletionTime": 4.5,
  "statusDistribution": {
    "not_started": 10,
    "in_progress": 15,
    "completed": 120,
    "deferred": 5
  },
  "priorityDistribution": {
    "low": 30,
    "normal": 80,
    "high": 30,
    "urgent": 10
  },
  "agentPerformance": [
    {
      "agentId": "agent_001",
      "agentName": "John Doe",
      "total": 50,
      "completed": 45
    }
  ]
}

Get Customer Tasks

Retrieve all tasks related to a specific customer.

Request

http
GET /v1/tasks/customer/cust_123?page=1&limit=20
x-tenant-api-key: your_api_key_here

Response

json
{
  "tasks": [...],
  "total": 5,
  "page": 1,
  "limit": 20,
  "totalPages": 1
}

Error Codes

CodeHTTP StatusDescription
AuthenticationError401Invalid or missing API key
ValidationError400Request validation failed
NotFoundError404Resource not found
InternalServerError500Internal server error

Input Constraints

FieldMax Length
title500 characters
description5000 characters
ownerName200 characters
completionNotes2000 characters
tags20 tags per task
tag length50 characters per tag
metadata keys50 keys
metadata value1000 characters

Pagination Limits

EndpointMax Limit
List Tasks100
Task Analytics5000

Audit Events

All operations are logged with structured audit events:

EventDescription
TASK_CREATEDTask created
TASK_UPDATEDTask updated
TASK_COMPLETEDTask completed
TASK_DELETEDTask deleted
TASK_REASSIGNEDTask reassigned to new owner
TASK_SNOOZEDTask snoozed

Transform WhatsApp into Your Business Growth Engine