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

# Lemlist: Get V2 Tasks

> Search your Lemlist tasks by contact, company, lead, campaign, assignee, status or due date. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Search your Lemlist tasks by contact, company, lead, campaign, assignee, status or due date.

> [!NOTE]
>
> Tool ID: `lemlist_get_v2_tasks`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'lemlist_get_v2_tasks',
  {
    "taskId": "task_123",
    "contactId": "contact_123",
    "contactIdNot": "example"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute lemlist_get_v2_tasks --input '{
  "taskId": "task_123",
  "contactId": "contact_123",
  "contactIdNot": "example"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "results": [
      {
        "_id": "_123",
        "objectType": "contact",
        "recordId": "record_123"
      }
    ],
    "total": 123,
    "limit": 123
  }
}
```

Use `deepline describe lemlist_get_v2_tasks --json` for the latest machine-readable contract.

## Input reference

Searches the team's tasks with the same vocabulary as the Tasks page: flat query parameters for the common filters, and an `advancedFilters` tree for everything else. Every status is returned unless `status` narrows it.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.taskId` | `string` | No | — | Task ids. At most 100. Several values (comma-separated or repeated) are OR-ed. |
| `payload.contactId` | `string` | No | — | Contact ids. A single id also matches the tasks of that contact's leads, exactly like the contact panel does. Several values (comma-separated or repeated) are OR-ed. |
| `payload.contactIdNot` | `string` | No | — | Excludes the given `contactId` values. |
| `payload.companyId` | `string` | No | — | Company ids. Matches company-level tasks AND tasks on that company's contacts. Several values (comma-separated or repeated) are OR-ed. |
| `payload.companyIdNot` | `string` | No | — | Excludes the given `companyId` values. |
| `payload.leadId` | `string` | No | — | Lead ids. Several values (comma-separated or repeated) are OR-ed. |
| `payload.leadIdNot` | `string` | No | — | Excludes the given `leadId` values. |
| `payload.campaignId` | `string` | No | — | Campaign ids. Several values (comma-separated or repeated) are OR-ed. |
| `payload.campaignIdNot` | `string` | No | — | Excludes the given `campaignId` values. |
| `payload.assignedTo` | `string` | No | — | Ids of the users the task is assigned to. Several values (comma-separated or repeated) are OR-ed. |
| `payload.assignedToNot` | `string` | No | — | Excludes the given `assignedTo` values. |
| `payload.objectType` | `"contact" \| "company"` | No | — | Restricts to the tasks hanging off a contact (a `contactId` or a `leadId` is present) or off a company (a `companyId` with no contact and no lead). Derived from the ids, never stored. Allowed: `contact`, `company`. |
| `payload.type` | `string` | No | — | Raw step types, comma-separated. This is the same vocabulary as v1 `type`. |
| `payload.typeNot` | `string` | No | — | Excludes the given `type` values. |
| `payload.channel` | `"aircall" \| "email" \| "linkedin" \| "whatsapp" \| "sms" \| "manual"` | No | — | Channel the task belongs to — the coarser nomenclature shown in the app as "Task type". Allowed: `aircall`, `email`, `linkedin`, `whatsapp`, `sms`, `manual`. |
| `payload.status` | `"due" \| "upcoming" \| "paused" \| "done" \| "ignored" \| "pending"` | No | — | Task statuses, comma-separated. `pending` is an alias for `due,upcoming,paused`. Unlike v1, completed tasks are returned unless you filter them out. Allowed: `due`, `upcoming`, `paused`, `done`, `ignored`, `pending`. |
| `payload.priority` | `string` | No | — | Task priorities (integers), comma-separated. |
| `payload.title` | `string` | No | — | Matches tasks whose title contains this text. |
| `payload.contactLinkedinUrl` | `string` | No | — | Matches tasks whose contact's LinkedIn URL contains this text. v1's `linkedin` filter matched the lead's URL instead. |
| `payload.dueDateFrom` | `string` | No | — | Lower bound of the due date, inclusive. ISO-8601. Format: `date-time`. |
| `payload.dueDateTo` | `string` | No | — | Upper bound of the due date, inclusive. ISO-8601. Format: `date-time`. |
| `payload.completedAtFrom` | `string` | No | — | Lower bound of the completion date (done or ignored), inclusive. ISO-8601. Format: `date-time`. |
| `payload.completedAtTo` | `string` | No | — | Upper bound of the completion date (done or ignored), inclusive. ISO-8601. Format: `date-time`. |
| `payload.hasCampaign` | `boolean` | No | — | Restricts to the tasks attached to a campaign (`true`) or to the standalone ones (`false`). |
| `payload.hasDueDate` | `boolean` | No | — | Restricts to the tasks carrying a due date (`true`) or to those without one (`false`). |
| `payload.search` | `string` | No | — | Free-text search over the task title and the contact / company text fields. |
| `payload.advancedFilters` | `string` | No | — | A filter tree encoded as JSON, addressing any field returned by `GET /v2/tasks/filters`. Max depth 5, max 50 conditions. |
| `payload.include` | `"contact" \| "company" \| "contact,company"` | No | — | Embeds the denormalized objects already carried by the task. Comma-separated. Allowed: `contact`, `company`, `contact,company`. |
| `payload.sortBy` | `"dueDate" \| "status" \| "priority" \| "assignedTo" \| "campaignId" \| "score" \| "handledOn" \| "contactJobTitle"` | No | `"dueDate"` | Field to sort on. Allowed: `dueDate`, `status`, `priority`, `assignedTo`, `campaignId`, `score`, `handledOn`, `contactJobTitle`. |
| `payload.sortOrder` | `"asc" \| "desc"` | No | `"desc"` | Sort direction. Allowed: `asc`, `desc`. |
| `payload.page` | `integer` | No | `1` | Page number, 1-based. `page * limit` must not exceed 10000. Minimum: 1. |
| `payload.limit` | `integer` | No | `50` | Page size. Minimum: 1. Maximum: 100. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Searches the team's tasks with the same vocabulary as the Tasks page: flat query parameters for the common filters, and an `advancedFilters` tree for everything else. Every status is returned unless `status` narrows it.",
    "properties": {
      "taskId": {
        "type": "string",
        "description": "Task ids. At most 100. Several values (comma-separated or repeated) are OR-ed."
      },
      "contactId": {
        "type": "string",
        "description": "Contact ids. A single id also matches the tasks of that contact's leads, exactly like the contact panel does. Several values (comma-separated or repeated) are OR-ed."
      },
      "contactIdNot": {
        "type": "string",
        "description": "Excludes the given `contactId` values."
      },
      "companyId": {
        "type": "string",
        "description": "Company ids. Matches company-level tasks AND tasks on that company's contacts. Several values (comma-separated or repeated) are OR-ed."
      },
      "companyIdNot": {
        "type": "string",
        "description": "Excludes the given `companyId` values."
      },
      "leadId": {
        "type": "string",
        "description": "Lead ids. Several values (comma-separated or repeated) are OR-ed."
      },
      "leadIdNot": {
        "type": "string",
        "description": "Excludes the given `leadId` values."
      },
      "campaignId": {
        "type": "string",
        "description": "Campaign ids. Several values (comma-separated or repeated) are OR-ed."
      },
      "campaignIdNot": {
        "type": "string",
        "description": "Excludes the given `campaignId` values."
      },
      "assignedTo": {
        "type": "string",
        "description": "Ids of the users the task is assigned to. Several values (comma-separated or repeated) are OR-ed."
      },
      "assignedToNot": {
        "type": "string",
        "description": "Excludes the given `assignedTo` values."
      },
      "objectType": {
        "type": "string",
        "description": "Restricts to the tasks hanging off a contact (a `contactId` or a `leadId` is present) or off a company (a `companyId` with no contact and no lead). Derived from the ids, never stored.",
        "enum": [
          "contact",
          "company"
        ]
      },
      "type": {
        "type": "string",
        "description": "Raw step types, comma-separated. This is the same vocabulary as v1 `type`."
      },
      "typeNot": {
        "type": "string",
        "description": "Excludes the given `type` values."
      },
      "channel": {
        "type": "string",
        "description": "Channel the task belongs to — the coarser nomenclature shown in the app as \"Task type\".",
        "enum": [
          "aircall",
          "email",
          "linkedin",
          "whatsapp",
          "sms",
          "manual"
        ]
      },
      "status": {
        "type": "string",
        "description": "Task statuses, comma-separated. `pending` is an alias for `due,upcoming,paused`. Unlike v1, completed tasks are returned unless you filter them out.",
        "enum": [
          "due",
          "upcoming",
          "paused",
          "done",
          "ignored",
          "pending"
        ]
      },
      "priority": {
        "type": "string",
        "description": "Task priorities (integers), comma-separated."
      },
      "title": {
        "type": "string",
        "description": "Matches tasks whose title contains this text."
      },
      "contactLinkedinUrl": {
        "type": "string",
        "description": "Matches tasks whose contact's LinkedIn URL contains this text. v1's `linkedin` filter matched the lead's URL instead."
      },
      "dueDateFrom": {
        "type": "string",
        "description": "Lower bound of the due date, inclusive. ISO-8601.",
        "format": "date-time"
      },
      "dueDateTo": {
        "type": "string",
        "description": "Upper bound of the due date, inclusive. ISO-8601.",
        "format": "date-time"
      },
      "completedAtFrom": {
        "type": "string",
        "description": "Lower bound of the completion date (done or ignored), inclusive. ISO-8601.",
        "format": "date-time"
      },
      "completedAtTo": {
        "type": "string",
        "description": "Upper bound of the completion date (done or ignored), inclusive. ISO-8601.",
        "format": "date-time"
      },
      "hasCampaign": {
        "type": "boolean",
        "description": "Restricts to the tasks attached to a campaign (`true`) or to the standalone ones (`false`)."
      },
      "hasDueDate": {
        "type": "boolean",
        "description": "Restricts to the tasks carrying a due date (`true`) or to those without one (`false`)."
      },
      "search": {
        "type": "string",
        "description": "Free-text search over the task title and the contact / company text fields."
      },
      "advancedFilters": {
        "type": "string",
        "description": "A filter tree encoded as JSON, addressing any field returned by `GET /v2/tasks/filters`. Max depth 5, max 50 conditions."
      },
      "include": {
        "type": "string",
        "description": "Embeds the denormalized objects already carried by the task. Comma-separated.",
        "enum": [
          "contact",
          "company",
          "contact,company"
        ]
      },
      "sortBy": {
        "type": "string",
        "description": "Field to sort on.",
        "default": "dueDate",
        "enum": [
          "dueDate",
          "status",
          "priority",
          "assignedTo",
          "campaignId",
          "score",
          "handledOn",
          "contactJobTitle"
        ]
      },
      "sortOrder": {
        "type": "string",
        "description": "Sort direction.",
        "default": "desc",
        "enum": [
          "asc",
          "desc"
        ]
      },
      "page": {
        "type": "integer",
        "description": "Page number, 1-based. `page * limit` must not exceed 10000.",
        "default": 1,
        "minimum": 1
      },
      "limit": {
        "type": "integer",
        "description": "Page size.",
        "default": 50,
        "minimum": 1,
        "maximum": 100
      }
    },
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Paginated response of `GET /v2/tasks`. |
| `result.data.results` | `array` | No | — | — |
| `result.data.results[]._id` | `string` | No | — | Unique task identifier |
| `result.data.results[].objectType` | `"contact" \| "company"` | No | — | Which record the task hangs off, derived from the ids Allowed: `contact`, `company`. |
| `result.data.results[].recordId` | `string \| null` | No | — | Id of that record — the company id for a company task, the contact id (or the lead id) otherwise |
| `result.data.results[].contactId` | `string \| null` | No | — | Associated contact id |
| `result.data.results[].companyId` | `string \| null` | No | — | Company id of the task, or of its contact |
| `result.data.results[].leadId` | `string \| null` | No | — | Associated lead id |
| `result.data.results[].campaignId` | `string \| null` | No | — | Campaign id |
| `result.data.results[].assignedTo` | `string \| null` | No | — | Id of the user the task is assigned to |
| `result.data.results[].title` | `string \| null` | No | — | Task title |
| `result.data.results[].message` | `string \| null` | No | — | Body of the task |
| `result.data.results[].text` | `string \| null` | No | — | Body of the reply that opened the task — `opportunityReplied` tasks only |
| `result.data.results[].type` | `"manual" \| "phone" \| "email" \| "linkedinInvite" \| "linkedinSend" \| "linkedinVoiceNote" \| "whatsappMessage" \| "opportunityReplied" \| "opportunityClicked"` | No | — | Raw step type Allowed: `manual`, `phone`, `email`, `linkedinInvite`, `linkedinSend`, `linkedinVoiceNote`, `whatsappMessage`, `opportunityReplied`, `opportunityClicked`. |
| `result.data.results[].channel` | `"aircall" \| "email" \| "linkedin" \| "whatsapp" \| "sms" \| "manual"` | No | — | Channel of the task Allowed: `aircall`, `email`, `linkedin`, `whatsapp`, `sms`, `manual`. |
| `result.data.results[].status` | `"due" \| "upcoming" \| "paused" \| "done" \| "ignored"` | No | — | Task status Allowed: `due`, `upcoming`, `paused`, `done`, `ignored`. |
| `result.data.results[].priority` | `integer \| null` | No | — | Task priority |
| `result.data.results[].dueDate` | `string \| null` | No | — | Due date Format: `date-time`. |
| `result.data.results[].completedAt` | `string \| null` | No | — | Date the task was done or ignored Format: `date-time`. |
| `result.data.results[].manual` | `boolean` | No | — | True when the task comes from a manual campaign step |
| `result.data.results[].ownerName` | `string \| null` | No | — | Full name of the assigned user |
| `result.data.results[].campaign` | `object \| null` | No | — | Campaign the task belongs to |
| `result.data.results[].campaign.id` | `string` | No | — | — |
| `result.data.results[].campaign.name` | `string` | No | — | — |
| `result.data.results[].campaign.sequenceId` | `string \| null` | No | — | — |
| `result.data.results[].leadFirstName` | `string \| null` | No | — | Lead's first name |
| `result.data.results[].leadLastName` | `string \| null` | No | — | Lead's last name |
| `result.data.results[].leadCompanyName` | `string \| null` | No | — | Lead's company name |
| `result.data.results[].contact` | `object \| null` | No | — | Denormalized contact — only with `include=contact` |
| `result.data.results[].company` | `object \| null` | No | — | Denormalized company — only with `include=company` |
| `result.data.total` | `integer` | No | — | Total number of matching tasks |
| `result.data.limit` | `integer` | No | — | Page size used |
| `result.data.page` | `integer` | No | — | Page returned, 1-based |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Paginated response of `GET /v2/tasks`.",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "A task as returned by `GET /v2/tasks`. Every key is always present — `null` rather than omitted.",
              "properties": {
                "_id": {
                  "type": "string",
                  "description": "Unique task identifier"
                },
                "objectType": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Which record the task hangs off, derived from the ids",
                  "enum": [
                    "contact",
                    "company"
                  ]
                },
                "recordId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Id of that record — the company id for a company task, the contact id (or the lead id) otherwise"
                },
                "contactId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Associated contact id"
                },
                "companyId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Company id of the task, or of its contact"
                },
                "leadId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Associated lead id"
                },
                "campaignId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Campaign id"
                },
                "assignedTo": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Id of the user the task is assigned to"
                },
                "title": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Task title"
                },
                "message": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Body of the task"
                },
                "text": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Body of the reply that opened the task — `opportunityReplied` tasks only"
                },
                "type": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Raw step type",
                  "enum": [
                    "manual",
                    "phone",
                    "email",
                    "linkedinInvite",
                    "linkedinSend",
                    "linkedinVoiceNote",
                    "whatsappMessage",
                    "opportunityReplied",
                    "opportunityClicked"
                  ]
                },
                "channel": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Channel of the task",
                  "enum": [
                    "aircall",
                    "email",
                    "linkedin",
                    "whatsapp",
                    "sms",
                    "manual"
                  ]
                },
                "status": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Task status",
                  "enum": [
                    "due",
                    "upcoming",
                    "paused",
                    "done",
                    "ignored"
                  ]
                },
                "priority": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Task priority"
                },
                "dueDate": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Due date",
                  "format": "date-time"
                },
                "completedAt": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Date the task was done or ignored",
                  "format": "date-time"
                },
                "manual": {
                  "type": "boolean",
                  "description": "True when the task comes from a manual campaign step"
                },
                "ownerName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Full name of the assigned user"
                },
                "campaign": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "Campaign the task belongs to",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "sequenceId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "leadFirstName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Lead's first name"
                },
                "leadLastName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Lead's last name"
                },
                "leadCompanyName": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Lead's company name"
                },
                "contact": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "Denormalized contact — only with `include=contact`"
                },
                "company": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "Denormalized company — only with `include=company`"
                }
              },
              "additionalProperties": false
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of matching tasks"
          },
          "limit": {
            "type": "integer",
            "description": "Page size used"
          },
          "page": {
            "type": "integer",
            "description": "Page returned, 1-based"
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Lemlist provider guide](https://deepline.com/docs/providers/lemlist/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.