> ## Documentation Index
> Fetch the complete documentation index at: https://api.docs.dealmachine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Tasks

> List all tasks for the organization

Returns a paginated list of tasks. Optionally filter by status, assignee, or search by title.

<ParamField query="page" type="integer" default={1}>
  Page number.
</ParamField>

<ParamField query="per_page" type="integer" default={25}>
  Results per page (1-100).
</ParamField>

<ParamField query="status" type="string">
  Filter by status: `open`, `completed`, or `all` (default).
</ParamField>

<ParamField query="search" type="string">
  Search tasks by title.
</ParamField>

<ParamField query="assigned_to_user_id" type="integer">
  Filter by assigned user ID.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.v2.dealmachine.com/v1/tasks?status=open" \
    -H "Authorization: Bearer dm_sk_live_xxx"
  ```

  ```typescript Node.js theme={null}
  const response = await fetch(
    "https://api.v2.dealmachine.com/v1/tasks?status=open",
    {
      headers: { Authorization: `Bearer ${apiKey}` },
    }
  );

  const { data } = await response.json();
  for (const task of data) {
    console.log(`${task.is_completed ? "[x]" : "[ ]"} ${task.title}`);
  }
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.v2.dealmachine.com/v1/tasks",
      headers={"Authorization": f"Bearer {api_key}"},
      params={"status": "open"},
  )

  for task in response.json()["data"]:
      status = "x" if task["is_completed"] else " "
      print(f"[{status}] {task['title']}")
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": [
      {
        "id": "task_001",
        "organization_id": 1,
        "opportunity_id": "42",
        "property_id": "prop_12345",
        "person_id": null,
        "created_by_user_id": 5,
        "assigned_to_user_id": 12,
        "assigned_to_agent_id": null,
        "title": "Schedule property walkthrough",
        "description": "Contact seller to arrange a visit",
        "is_completed": false,
        "completed_at": null,
        "completed_by_user_id": null,
        "due_date": "2026-03-10T00:00:00Z",
        "sort_order": 0,
        "created_at": "2026-03-01T09:00:00Z",
        "updated_at": "2026-03-01T09:00:00Z"
      },
      {
        "id": "task_002",
        "organization_id": 1,
        "opportunity_id": null,
        "property_id": null,
        "person_id": "per_67890",
        "created_by_user_id": 5,
        "assigned_to_user_id": null,
        "assigned_to_agent_id": null,
        "title": "Follow up with contact",
        "description": null,
        "is_completed": true,
        "completed_at": "2026-03-02T14:00:00Z",
        "completed_by_user_id": 5,
        "due_date": null,
        "sort_order": 1,
        "created_at": "2026-03-01T09:00:00Z",
        "updated_at": "2026-03-02T14:00:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "per_page": 25,
      "total": 2,
      "has_more": false
    }
  }
  ```
</ResponseExample>

## Response Fields

| Field                  | Type           | Description                    |
| ---------------------- | -------------- | ------------------------------ |
| `id`                   | string         | Task ID                        |
| `organization_id`      | number         | Organization ID                |
| `opportunity_id`       | string \| null | Linked CRM opportunity ID      |
| `property_id`          | string \| null | Linked property ID             |
| `person_id`            | string \| null | Linked person ID               |
| `created_by_user_id`   | number         | User who created the task      |
| `assigned_to_user_id`  | number \| null | Assigned user                  |
| `assigned_to_agent_id` | string \| null | Assigned agent                 |
| `title`                | string         | Task title                     |
| `description`          | string \| null | Task description               |
| `is_completed`         | boolean        | Whether the task is complete   |
| `completed_at`         | string \| null | ISO 8601 completion timestamp  |
| `completed_by_user_id` | number \| null | User who completed the task    |
| `due_date`             | string \| null | ISO 8601 due date              |
| `sort_order`           | number         | Display order                  |
| `created_at`           | string         | ISO 8601 creation timestamp    |
| `updated_at`           | string         | ISO 8601 last update timestamp |
