Skip to main content
POST
/
tasks
Create Task
curl --request POST \
  --url https://api.lemlist.com/api/tasks \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "phone",
  "assignedTo": "usr_7YzNqVRMCfdeHEzMn",
  "dueDate": "2025-02-10T09:58:57.169Z",
  "leadId": "lea_zUwSUPSxozD9fLVGw"
}
'
import requests

url = "https://api.lemlist.com/api/tasks"

payload = {
    "type": "phone",
    "assignedTo": "usr_7YzNqVRMCfdeHEzMn",
    "dueDate": "2025-02-10T09:58:57.169Z",
    "leadId": "lea_zUwSUPSxozD9fLVGw"
}
headers = {
    "Authorization": "Basic <encoded-value>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    type: 'phone',
    assignedTo: 'usr_7YzNqVRMCfdeHEzMn',
    dueDate: '2025-02-10T09:58:57.169Z',
    leadId: 'lea_zUwSUPSxozD9fLVGw'
  })
};

fetch('https://api.lemlist.com/api/tasks', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
require 'uri'
require 'net/http'

url = URI("https://api.lemlist.com/api/tasks")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"phone\",\n  \"assignedTo\": \"usr_7YzNqVRMCfdeHEzMn\",\n  \"dueDate\": \"2025-02-10T09:58:57.169Z\",\n  \"leadId\": \"lea_zUwSUPSxozD9fLVGw\"\n}"

response = http.request(request)
puts response.read_body
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.lemlist.com/api/tasks",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'type' => 'phone',
    'assignedTo' => 'usr_7YzNqVRMCfdeHEzMn',
    'dueDate' => '2025-02-10T09:58:57.169Z',
    'leadId' => 'lea_zUwSUPSxozD9fLVGw'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Basic <encoded-value>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
{
  "_id": "opp_LyXDV8KHzctQdLFpG",
  "type": "manual",
  "title": "Keep an eye on him",
  "priority": 1,
  "leadId": "lea_fiDpiGV585wy3Oii2",
  "campaignId": "cam_bSn8EORHQxbWPjHvu",
  "contactId": "ctc_xW8Ou6C03Csv8vatp",
  "dueDate": "2025-11-10T09:58:57.169Z",
  "userId": "usr_ahfFktBBHUIxbVG5P",
  "content": "does he have bandwidth to help us? would be grand"
}
"Bad team"
"The authentication you supplied is incorrect"
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.

LinkedIn task attachments

When creating a task with type: "linkedin", you can attach images and videos to the LinkedIn message by passing public HTTPS URLs in the images and videos arrays. lemlist downloads each file and re-hosts it before attaching it to the task.
ConstraintValue
Maximum items per task6 (combined across images + videos)
Maximum file size20 MB per file
Allowed image MIME typesimage/png, image/jpeg, image/gif
Allowed video MIME typesvideo/mp4, video/quicktime
The images and videos fields are ignored when type is not linkedin. Ingestion errors return the same LINKEDIN_MEDIA_* codes documented on Add Step to Sequence.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
type
enum<string>
required

The type of task.

Available options:
email,
manual,
phone,
linkedin
assignedTo
string
required

The ID of the team member assigned to the task (userId).

dueDate
string<date-time>
required

The due date in ISO 8601 format (e.g., 2025-02-12T00:00:00.000Z).

recordId
string

The ID of the contact company or lead associated with the task.

title
string
default:""

Optional title of the task. Defaults to an empty string if omitted.

message
string
default:""

Optional message/description of the task. Defaults to an empty string if omitted.

priority
enum<string>
default:""

Priority level of the task.

Available options:
,
0,
1,
2
images
string<uri>[]

Public HTTPS URLs of images to attach to a linkedin task. lemlist downloads each file and re-hosts it. Ignored when type is not linkedin. Allowed MIME types: image/png, image/jpeg, image/gif. Up to 20 MB per file, and up to 6 items total combined with videos.

videos
string<uri>[]

Public HTTPS URLs of videos to attach to a linkedin task. lemlist downloads each file and re-hosts it. Ignored when type is not linkedin. Allowed MIME types: video/mp4, video/quicktime. Up to 20 MB per file, and up to 6 items total combined with images.

Response

Success

A manual action assigned to a user to complete.

_id
string

Unique task identifier

type
string

Task type

leadId
string

Associated lead ID

campaignId
string

Campaign ID

userId
string

Assigned user ID

status
enum<string>

Task status

Available options:
pending,
completed,
ignored
dueDate
string<date-time>

Due date timestamp

createdAt
string<date-time>

Creation timestamp

completedAt
string<date-time>

Completion timestamp