Skip to main content

List Tasks

Retrieve all tasks for the authenticated user.
GET
/api/tasks

Query Parameters

ParameterTypeDescription
statusstringpending, in_progress, completed
prioritystringlow, medium, high
dueDatestringFilter by due date (ISO 8601)
categorystringFilter by category ID

Response

{
  "tasks": [
    {
      "_id": "task_abc123",
      "title": "Renew home insurance",
      "description": "Policy expires March 15, 2025",
      "dueDate": "2025-03-01T00:00:00Z",
      "status": "pending",
      "priority": "high",
      "linkedDocument": "doc_xyz789",
      "createdAt": "2024-01-15T10:30:00Z"
    }
  ]
}

Get Task

Retrieve a single task by ID.
GET
/api/tasks/:id

Path Parameters

ParameterTypeDescription
idstringTask ID

Create Task

Create a new task.
POST
/api/tasks

Request Body

{
  "title": "Pay electricity bill",
  "description": "Due amount: $150",
  "dueDate": "2024-02-15T00:00:00Z",
  "priority": "medium",
  "category": "cat_bills"
}
FieldTypeRequiredDescription
titlestringYesTask title
descriptionstringNoTask details
dueDatestringYesISO 8601 date
prioritystringNolow, medium, high
categorystringNoCategory ID
linkedDocumentstringNoDocument ID

Response

{
  "_id": "task_new123",
  "title": "Pay electricity bill",
  "status": "pending",
  "createdAt": "2024-01-20T14:00:00Z"
}

Update Task

Update an existing task.
PATCH
/api/tasks/:id

Request Body

{
  "status": "completed"
}
Any task field can be updated.

Delete Task

Delete a task.
DELETE
/api/tasks/:id

Response

{
  "message": "Task deleted successfully"
}

Get Task Suggestions

Get AI-generated task suggestions for a document.
GET
/api/tasks/:documentId/suggestions

Response

{
  "suggestions": [
    {
      "title": "Renew insurance policy",
      "suggestedDueDate": "2025-03-01T00:00:00Z",
      "priority": "high",
      "reason": "Policy expires March 15, 2025"
    }
  ]
}

Task Object

FieldTypeDescription
_idstringUnique identifier
userIdstringOwner user ID
titlestringTask title
descriptionstringTask details
dueDatestringISO 8601 due date
statusstringpending, in_progress, completed
prioritystringlow, medium, high
categoriesarrayAssigned categories
linkedDocumentstringAssociated document ID
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp