> ## 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 Task Operations: Inputs, Cost & CLI Example

> Creating manual tasks/opportunities. Includes inputs, outputs, pricing notes, Deepline CLI examples, and GTM automation guidance.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=lemlist_create_task:{"type":"email","assigned_to":"{{assigned_to}}","due_date":"{{due_date}}"}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                  | Type                                           | Required | Default | Description |
| --------------------- | ---------------------------------------------- | -------- | ------- | ----------- |
| `payload.record_id`   | `string`                                       | No       |         |             |
| `payload.lead_id`     | `string`                                       | No       |         |             |
| `payload.type`        | `"email" \| "manual" \| "phone" \| "linkedin"` | Yes      |         |             |
| `payload.assigned_to` | `string`                                       | Yes      |         |             |
| `payload.due_date`    | `string`                                       | Yes      |         |             |
| `payload.title`       | `string`                                       | No       |         |             |
| `payload.message`     | `string`                                       | No       |         |             |
| `payload.priority`    | `"0" \| "1" \| "2"`                            | No       |         |             |

### Allowed values

| Field              | Allowed values                         |
| ------------------ | -------------------------------------- |
| `payload.type`     | `email`, `manual`, `phone`, `linkedin` |
| `payload.priority` | `0`, `1`, `2`                          |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Create task.",
    "properties": {
      "record_id": {
        "type": "string",
        "minLength": 1
      },
      "lead_id": {
        "type": "string",
        "minLength": 1
      },
      "type": {
        "type": "string",
        "enum": [
          "email",
          "manual",
          "phone",
          "linkedin"
        ]
      },
      "assigned_to": {
        "type": "string",
        "minLength": 1
      },
      "due_date": {
        "type": "string",
        "minLength": 1,
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,3})?(?:Z|[+-]\\d{2}:\\d{2})$",
        "format": "date-time"
      },
      "title": {
        "type": "string"
      },
      "message": {
        "type": "string"
      },
      "priority": {
        "type": "string",
        "enum": [
          "0",
          "1",
          "2"
        ]
      }
    },
    "required": [
      "type",
      "assigned_to",
      "due_date"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output Schema

| Name            | Type     | Required | Default | Description |
| --------------- | -------- | -------- | ------- | ----------- |
| `result.status` | `string` | Yes      |         |             |
| `result.result` | `object` | Yes      |         |             |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "status": {
        "type": "string"
      },
      "result": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "assigned_to": {
            "type": "string"
          },
          "due_date": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "done": {
            "type": "boolean"
          }
        },
        "required": [
          "_id",
          "type",
          "assigned_to",
          "due_date",
          "title",
          "priority",
          "done"
        ],
        "additionalProperties": true
      }
    },
    "required": [
      "status",
      "result"
    ],
    "additionalProperties": true
  }
  ```
</details>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute lemlist_create_task --payload '{
  "type": "email",
  "assigned_to": "string",
  "due_date": "string"
}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Provider API Context

<details>
  <summary>Show provider reference (optional)</summary>

  ```md theme={null}
  > Create a manual task (opportunity) associated with a contact/company or lead.

  export const SnippetObjectReference = ({objectName, objectPath = null}) => {
    const lowerCaseObjectName = objectName.toLowerCase();
    if (lowerCaseObjectName === 'lead' || lowerCaseObjectName === 'leads') {
      return &lt;Note>
          This endpoint uses the &lt;a href={`/api-reference/objects-definitions/${objectPath}`}>{objectName} object&lt;/a>. Make sure to also check the &lt;a href={`/api-reference/objects-definitions/${lowerCaseObjectName === 'lead' ? 'contact' : 'lead'}`}>{lowerCaseObjectName === 'lead' ? 'Contact' : 'Lead'} object&lt;/a> to understand the distinction between the two.
        &lt;/Note>;
    }
    return &lt;Note>
        This endpoint uses the &lt;a href={`/api-reference/objects-definitions/${objectPath}`}>{objectName} object&lt;/a>.
      &lt;/Note>;
  };

  &lt;SnippetObjectReference objectName="Task" objectPath="task" />

  Create a manual task (opportunity) associated with a contact/company or lead. The task must be assigned to a team member and have a due date. Optional fields let you set a title, message, and priority.

  ## 72. Get Many Tasks

  Source: https://developer.lemlist.com/api-reference/endpoints/tasks/get-many-tasks.md
  ```
</details>

## Cost

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