Tasks

Tasks represent workflow items that can be assigned to users within a client account. Tasks support hierarchical organization through subtasks and integrate with the chat system for communication.

Endpoints

List Tasks

GET /api/v2/tasks

Retrieves a paginated list of tasks.

Query Parameters

Parameter Type Required Description
client_account_id integer Yes ID of the client account
assigned_to_id integer No Filter by assigned user ID
parent_task_id integer No Filter by parent task ID (use null for top-level tasks)
status string No Filter by task status
task_type string No Filter by task type
relation_type string No Filter by related entity type
relation_id integer No Filter by related entity ID
page integer No Page number
per_page integer No Items per page

Response

{
  "data": [
    {
      "id": 1,
      "title": "Review Q1 journal entries",
      "description": "Check all journal entries for Q1 2024",
      "status": "OPEN",
      "task_type": "review",
      "completed_at": null,
      "completion_summary": null,
      "client_account_id": 7,
      "assigned_to_id": 7,
      "provider_client_account_id": null,
      "parent_task_id": null,
      "relation_type": null,
      "relation_id": null,
      "thread_id": 42,
      "created_at": "2024-03-15T10:00:00Z",
      "updated_at": "2024-03-15T10:00:00Z",
      "created_by_id": 7,
      "updated_by_id": null
    }
  ],
  "meta": {
    "page": 1,
    "pages": 1,
    "per_page": 25,
    "records": 1
  }
}

Create Task

POST /api/v2/tasks

Creates a new task.

Request Body

Field Type Required Description
title string Yes Task title
description string No Detailed task description
status string No Initial status
task_type string No Type of task
completion_summary string No Summary when completed
client_account_id integer Yes The client account ID
assigned_to_id integer No User ID to assign the task to
provider_client_account_id integer No Provider client account ID
parent_task_id integer No Parent task ID for creating subtasks
relation_type string No Type of related entity
relation_id integer No ID of related entity

Response

Returns the created task with status 201 Created.

Get Task

GET /api/v2/tasks/{id}

Retrieves a specific task by ID.

Response

Returns a single task object.

Update Task

PUT /api/v2/tasks/{id}

Updates an existing task.

Request Body

Same fields as Create Task. All fields are optional for updates.

Response

Returns the updated task.

Delete Task

DELETE /api/v2/tasks/{id}

Deletes a task and its associated chat channel.

Response

Returns 204 No Content on success.

Attributes

Attribute Type Description
id integer Unique identifier (read-only)
title string Task title
description string Detailed task description
status string Task status
task_type string Type of task
completed_at datetime When the task was completed (read-only)
completion_summary string Summary of completion
client_account_id integer ID of the client account
assigned_to_id integer ID of the assigned user
provider_client_account_id integer ID of provider client account
parent_task_id integer ID of the parent task
relation_type string Type of related entity
relation_id integer ID of related entity
thread_id integer Associated chat thread ID (read-only)
created_at datetime Creation timestamp (read-only)
updated_at datetime Last update timestamp (read-only)
created_by_id integer ID of the creating user (read-only)
updated_by_id integer ID of the last updating user (read-only)

Relationships

Relationship Type Description
subtasks Task[] Child tasks
parent_task Task Parent task

Business Rules

  1. Deleting a task also deletes its associated chat channel
  2. Tasks can be organized hierarchically using parent_task_id
  3. Each task automatically gets a chat thread for discussion

Error Responses

Status Code Description
400 Invalid request (missing required fields)
403 Forbidden (no access to client account)
404 Task not found