# Get Tasks

GET https://services.leadconnectorhq.com/projects/lists/{listId}/tasks

Pages tasks whose primary (home) list is this list. Use `limit` and query `searchAfter` from the previous response `searchAfter` (opaque base64url string). Prefer Search Tasks with `parentTaskId` / `subtaskViewMode` for subtask-focused views.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `projects/tasks.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `listId` | string | Yes | List id |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | number | No | Maximum number of tasks per page. Defaults to 50. |
| `searchAfter` | string | No | Opaque searchAfter from the previous response `searchAfter` (base64url-encoded JSON array). Pass the string back verbatim. Legacy JSON array strings (e.g. `[1738683828372,"taskId"]`) are also accepted. |
| `locationId` | string | No | Location id. **Required for `channel: APP`.** Ignored for OAuth/PIT — those use the location on the auth token. Do not send in path, body, or headers. |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "2021-07-28"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/projects/lists/{listId}/tasks": {
      "get": {
        "summary": "Get Tasks",
        "operationId": "getTasks",
        "description": "Pages tasks whose primary (home) list is this list. Use `limit` and query `searchAfter` from the previous response `searchAfter` (opaque base64url string). Prefer Search Tasks with `parentTaskId` / `subtaskViewMode` for subtask-focused views.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2021-07-28"
              ]
            }
          },
          {
            "name": "listId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string",
              "example": "6a102435124ecfb348bd5507",
              "description": "List id"
            },
            "description": "List id"
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Maximum number of tasks per page. Defaults to 50.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 50,
              "example": 50,
              "type": "number",
              "description": "Page size"
            }
          },
          {
            "name": "searchAfter",
            "required": false,
            "in": "query",
            "description": "Opaque searchAfter from the previous response `searchAfter` (base64url-encoded JSON array). Pass the string back verbatim. Legacy JSON array strings (e.g. `[1738683828372,\"taskId\"]`) are also accepted.",
            "schema": {
              "example": "WzE3Mzg2ODM4MjgzNzIsIjY3YTIzNWI0OWIyODk0MzFiY2Y2NTdmOCJd",
              "type": "string",
              "description": "Opaque searchAfter for task list/search (base64url-encoded JSON array). Pass the response `searchAfter` back verbatim. `null` when no further page."
            }
          },
          {
            "name": "locationId",
            "required": false,
            "in": "query",
            "description": "Location id. **Required for `channel: APP`.** Ignored for OAuth/PIT — those use the location on the auth token. Do not send in path, body, or headers.",
            "schema": {
              "example": "ve9EPM428h8b87FE9C12Kg",
              "type": "string",
              "description": "Location id. Required for APP channel (`?locationId=`). Ignored for OAuth/PIT (token location is used). Do not send in path, body, or headers."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsTaskSearchResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden — missing scope or no access to this space, folder, list, or task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found — space, folder, list, task, comment, or recurring task missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectsErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "projects/tasks.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "ProjectsTaskSearchResponseDto": {
        "type": "object",
        "description": "Task search / list-tasks results. `searchAfter` is an opaque base64url string when more pages exist. Pass it back verbatim as Search Tasks body `searchAfter` or Get Tasks query `searchAfter`.",
        "required": [
          "tasks",
          "total"
        ],
        "properties": {
          "tasks": {
            "type": "array",
            "description": "Matching tasks",
            "items": {
              "type": "object",
              "description": "Public task record. Assignees are `assignees` (never CO `owners`). Priority is `properties.priority` 1–4 (never `priorityN`). Location custom-field values appear as extra keys under `properties`. `graph` and `listPositions` are not returned — use Get Lists For A Task and `properties.primaryListId` for membership.",
              "required": [
                "id",
                "properties"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Task id",
                  "example": "6a102435124ecfb348bd5509"
                },
                "locationId": {
                  "type": "string",
                  "description": "Location id",
                  "example": "ve9EPM428h8b87FE9C12Kg"
                },
                "objectKey": {
                  "type": "string",
                  "description": "Always `task` for Project Management tasks when present. Optional for forward compatibility. Allowed: `task`.",
                  "enum": [
                    "task"
                  ],
                  "example": "task"
                },
                "assignees": {
                  "type": "array",
                  "description": "Assignee user ids (same values accepted on create/update as `assignees`)",
                  "items": {
                    "type": "string"
                  },
                  "example": [
                    "user_1"
                  ]
                },
                "parentName": {
                  "type": "string",
                  "description": "Parent task title. Populated only by Search Tasks with `subtaskViewMode=separate`. Not returned by Get Task By ID, Get Tasks, or Fetch Tasks By IDs.",
                  "example": "Parent task"
                },
                "createdAt": {
                  "type": "string",
                  "description": "When the task was created (ISO-8601)",
                  "example": "2026-09-20T10:00:00.000Z"
                },
                "updatedAt": {
                  "type": "string",
                  "description": "When the task was last updated (ISO-8601). Use as a Search filter (`gte`) and sort field for incremental sync.",
                  "example": "2026-09-21T12:00:00.000Z"
                },
                "createdBy": {
                  "type": "object",
                  "description": "Who created the task",
                  "properties": {
                    "sourceId": {
                      "type": "string",
                      "description": "User or resource id",
                      "example": "user_1"
                    },
                    "source": {
                      "type": "string",
                      "description": "Creation source. Common values: `PUBLIC_API`, `USER`.",
                      "example": "PUBLIC_API"
                    },
                    "channel": {
                      "type": "string",
                      "description": "Creation channel. Common values: `OAUTH`, `APP`, `IST`.",
                      "example": "OAUTH"
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "Stamp time (ISO-8601)",
                      "example": "2026-09-20T10:00:00.000Z"
                    }
                  },
                  "example": {
                    "sourceId": "user_1",
                    "source": "PUBLIC_API",
                    "channel": "OAUTH",
                    "createdAt": "2026-09-20T10:00:00.000Z"
                  }
                },
                "subtasks": {
                  "type": "array",
                  "description": "Embedded child tasks — **Search Tasks only**, when `subtaskViewMode=expanded`. Never returned by Get Task, Create Task, Update Task, Get Tasks (list), or Fetch Tasks By IDs.",
                  "items": "circular(ProjectsTaskRecordDto)",
                  "example": [
                    {
                      "id": "6a102435124ecfb348bd5510",
                      "locationId": "ve9EPM428h8b87FE9C12Kg",
                      "objectKey": "task",
                      "assignees": [
                        "user_1"
                      ],
                      "properties": {
                        "title": "Call notes",
                        "status": "to_do",
                        "dueDate": "2026-09-20T17:00:00.000Z",
                        "priority": 3,
                        "primaryListId": "6a102435124ecfb348bd5507",
                        "parentTaskId": "6a102435124ecfb348bd5509"
                      }
                    }
                  ]
                },
                "properties": {
                  "type": "object",
                  "description": "Task fields plus location custom-field values as extra keys (no `task.` prefix). Reserved keys, do not use these names for custom fields: `title`, `body`, `status`, `statusGroup`, `dueDate`, `startDate`, `priority`, `primaryListId`, `parentTaskId`, `contactId`, `businessId`. `statusGroup` is read-only.",
                  "required": [
                    "title"
                  ],
                  "properties": {
                    "title": {
                      "type": "string",
                      "description": "Task title",
                      "example": "Follow up with client"
                    },
                    "body": {
                      "type": "string",
                      "description": "Task body as TipTap HTML or TipTap JSON (same field as comment `body`). See [TipTap documentation](https://tiptap.dev/docs/editor/introduction).",
                      "example": "<p>Call the client about renewal</p>"
                    },
                    "status": {
                      "type": "string",
                      "description": "Status **key** from the space workflow (not the label). Location-defined — discover via Get Statuses or Get List Statuses.",
                      "example": "to_do"
                    },
                    "statusGroup": {
                      "type": "string",
                      "description": "Server-derived group key for `status`. Read-only — do not send on create or update. A task is complete when this is `done`.",
                      "example": "to_do"
                    },
                    "dueDate": {
                      "type": "string",
                      "description": "Due date (ISO-8601)",
                      "example": "2026-09-20T17:00:00.000Z"
                    },
                    "startDate": {
                      "type": "string",
                      "description": "Start date (ISO-8601)",
                      "example": "2026-09-20T10:00:00.000Z"
                    },
                    "priority": {
                      "type": "number",
                      "description": "Priority level. Allowed: `1` (highest), `2`, `3`, `4` (lowest).",
                      "enum": [
                        1,
                        2,
                        3,
                        4
                      ],
                      "example": 2
                    },
                    "primaryListId": {
                      "type": "string",
                      "description": "Home list id",
                      "example": "6a102435124ecfb348bd5507"
                    },
                    "parentTaskId": {
                      "type": "string",
                      "description": "Parent task id when this task is a subtask. This is the field to read.",
                      "example": "6a102435124ecfb348bd5508"
                    },
                    "contactId": {
                      "type": "string",
                      "description": "Linked contact id",
                      "example": "sx6wyHhbFdRXh302Lunr"
                    },
                    "businessId": {
                      "type": "string",
                      "description": "Linked business id",
                      "example": "biz_1"
                    }
                  },
                  "additionalProperties": {
                    "description": "Value for one custom field. Type depends on the field definition (string, number, boolean, array, or null). Discover keys via the Custom Fields API with `objectKey: \"task\"`.",
                    "oneOf": [
                      {
                        "type": "string",
                        "nullable": true,
                        "example": "discovery"
                      },
                      {
                        "type": "number",
                        "example": 42
                      },
                      {
                        "type": "boolean",
                        "example": true
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "example": [
                          "option_a"
                        ]
                      }
                    ]
                  },
                  "example": {
                    "title": "Follow up with client",
                    "status": "to_do",
                    "dueDate": "2026-09-20T17:00:00.000Z",
                    "priority": 2,
                    "primaryListId": "6a102435124ecfb348bd5507",
                    "project_phase": "discovery"
                  }
                }
              },
              "title": "ProjectsTaskRecordDto"
            },
            "example": [
              {
                "id": "6a102435124ecfb348bd5509",
                "locationId": "ve9EPM428h8b87FE9C12Kg",
                "objectKey": "task",
                "assignees": [
                  "user_1"
                ],
                "properties": {
                  "title": "Follow up with client",
                  "status": "to_do",
                  "dueDate": "2026-09-20T17:00:00.000Z",
                  "priority": 2,
                  "primaryListId": "6a102435124ecfb348bd5507"
                }
              }
            ]
          },
          "total": {
            "type": "number",
            "description": "Total matching count",
            "example": 1
          },
          "searchAfter": {
            "type": "string",
            "nullable": true,
            "description": "Opaque searchAfter (base64url-encoded JSON array, typically `[sortValue, taskId]`). Pass back verbatim as Search Tasks body `searchAfter` or Get Tasks query `searchAfter`. `null` when there is no further page.",
            "example": "WzE3Mzg2ODM4MjgzNzIsIjY3YTIzNWI0OWIyODk0MzFiY2Y2NTdmOCJd"
          }
        },
        "title": "ProjectsTaskSearchResponseDto"
      },
      "ProjectsErrorResponseDto": {
        "type": "object",
        "description": "Error payload for non-2xx responses. Same shape on every Projects operation.\n\n`message` is a string, or a string array for validation failures.\n\n`error` is usually the HTTP reason phrase (`Bad Request`, `Unprocessable Entity`, …). Known domain values include `graph_scope_invalid` (Search list-scope failures).\n\nWhen `error` is `graph_scope_invalid`, `reason` discriminates the failure: `too_many_ids` | `non_list_type` | `duplicate_graph_scope`.",
        "required": [
          "statusCode",
          "message"
        ],
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code",
            "example": 422
          },
          "message": {
            "description": "Human-readable message, or a list of validation messages",
            "oneOf": [
              {
                "type": "string",
                "example": "Task is already in the destination list"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "example": [
                  "dueDate must be a string"
                ]
              }
            ],
            "example": null
          },
          "error": {
            "type": "string",
            "description": "HTTP reason phrase or domain code when present. Domain codes seen today: `graph_scope_invalid`. Otherwise Nest’s reason phrase.",
            "example": "graph_scope_invalid"
          },
          "reason": {
            "type": "string",
            "description": "Present when `error` is `graph_scope_invalid`. Discriminates Search list-scope failures. Allowed: `too_many_ids`, `non_list_type`, `duplicate_graph_scope`.",
            "enum": [
              "too_many_ids",
              "non_list_type",
              "duplicate_graph_scope"
            ],
            "example": "too_many_ids"
          }
        },
        "example": {
          "statusCode": 422,
          "message": "graph.id scope may not exceed 10 list IDs",
          "error": "graph_scope_invalid",
          "reason": "too_many_ids"
        },
        "title": "ProjectsErrorResponseDto"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/projects/lists/<listId>/tasks' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: 2021-07-28'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: '2021-07-28'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/projects/lists/<listId>/tasks', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/projects/lists/{listId}/tasks"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "2021-07-28"
}

response = requests.get(url, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/projects/lists/<listId>/tasks',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: 2021-07-28',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/projects/lists/<listId>/tasks")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "2021-07-28")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://services.leadconnectorhq.com/projects/lists/<listId>/tasks"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "2021-07-28")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/projects/lists/<listId>/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "2021-07-28"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "2021-07-28"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/projects/lists/<listId>/tasks' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
