curl --request POST \
--url https://api.lemlist.com/api/tasks \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"recordId": "ctc_ZpFy8SXl51PsctTGf",
"type": "phone",
"assignedTo": "usr_6nVZY7je1zSBXZgZK",
"dueDate": "2025-02-10T09:58:57.169Z"
}
'import requests
url = "https://api.lemlist.com/api/tasks"
payload = {
"recordId": "ctc_ZpFy8SXl51PsctTGf",
"type": "phone",
"assignedTo": "usr_6nVZY7je1zSBXZgZK",
"dueDate": "2025-02-10T09:58:57.169Z"
}
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({
recordId: 'ctc_ZpFy8SXl51PsctTGf',
type: 'phone',
assignedTo: 'usr_6nVZY7je1zSBXZgZK',
dueDate: '2025-02-10T09:58:57.169Z'
})
};
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 \"recordId\": \"ctc_ZpFy8SXl51PsctTGf\",\n \"type\": \"phone\",\n \"assignedTo\": \"usr_6nVZY7je1zSBXZgZK\",\n \"dueDate\": \"2025-02-10T09:58:57.169Z\"\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([
'recordId' => 'ctc_ZpFy8SXl51PsctTGf',
'type' => 'phone',
'assignedTo' => 'usr_6nVZY7je1zSBXZgZK',
'dueDate' => '2025-02-10T09:58:57.169Z'
]),
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"
}{
"error": "recordId is required"
}"The authentication you supplied is incorrect"Create Task
Create a manual task (opportunity) associated with a contact/company or lead.
curl --request POST \
--url https://api.lemlist.com/api/tasks \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"recordId": "ctc_ZpFy8SXl51PsctTGf",
"type": "phone",
"assignedTo": "usr_6nVZY7je1zSBXZgZK",
"dueDate": "2025-02-10T09:58:57.169Z"
}
'import requests
url = "https://api.lemlist.com/api/tasks"
payload = {
"recordId": "ctc_ZpFy8SXl51PsctTGf",
"type": "phone",
"assignedTo": "usr_6nVZY7je1zSBXZgZK",
"dueDate": "2025-02-10T09:58:57.169Z"
}
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({
recordId: 'ctc_ZpFy8SXl51PsctTGf',
type: 'phone',
assignedTo: 'usr_6nVZY7je1zSBXZgZK',
dueDate: '2025-02-10T09:58:57.169Z'
})
};
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 \"recordId\": \"ctc_ZpFy8SXl51PsctTGf\",\n \"type\": \"phone\",\n \"assignedTo\": \"usr_6nVZY7je1zSBXZgZK\",\n \"dueDate\": \"2025-02-10T09:58:57.169Z\"\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([
'recordId' => 'ctc_ZpFy8SXl51PsctTGf',
'type' => 'phone',
'assignedTo' => 'usr_6nVZY7je1zSBXZgZK',
'dueDate' => '2025-02-10T09:58:57.169Z'
]),
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"
}{
"error": "recordId is required"
}"The authentication you supplied is incorrect"Draft of message tasks
Onemail, linkedin and whatsapp tasks, lemlist also creates the draft of the message to send. Set its body with taskData.content and, on an email task, its subject with taskData.subject. message is the task instruction.
LinkedIn task attachments
When creating a task withtype: "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.
| Constraint | Value |
|---|---|
| Maximum items per task | 6 (combined across images + videos) |
| Maximum file size | 20 MB per file |
| Allowed image MIME types | image/png, image/jpeg, image/gif |
| Allowed video MIME types | video/mp4, video/quicktime |
images and videos are not downloaded, but they are still validated and count toward the limit of 6. Ingestion errors return the same LINKEDIN_MEDIA_* codes and HTTP statuses as Add Step to Sequence, with error holding a JSON-encoded array of { url, index, code, message } items.Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
- recordId
- leadId (legacy)
ID of the record the task is about: a contact (ctc_), a company (cpn_) or a lead (lea_). Required unless the legacy leadId is sent. A company task can only be of type manual.
The type of task.
email, manual, phone, linkedin, whatsapp The ID of the team member assigned to the task (userId).
The due date in ISO 8601 format (e.g., 2025-02-12T00:00:00.000Z). A date in the past is accepted: the task is created already due.
Legacy name of recordId, still accepted for backward compatibility. Use recordId instead. When both are sent, leadId is used.
Optional title of the task. Defaults to an empty string if omitted.
400Optional instruction of the task, returned as content in the response. Defaults to an empty string if omitted. On a linkedin task for a lead (lea_ ID), it also pre-fills the draft when taskData.content is omitted.
32000Draft of the message to send on email, linkedin and whatsapp tasks, and fallback number on phone tasks.
Show child attributes
Show child attributes
Priority level of the task.
, 0, 1, 2 Public HTTPS URLs of images to attach to a linkedin task. lemlist downloads each file and re-hosts it. On other types they are not downloaded, but still count toward the limit of 6. Allowed MIME types: image/png, image/jpeg, image/gif. Up to 20 MB per file, and up to 6 items total combined with videos.
Public HTTPS URLs of videos to attach to a linkedin task. lemlist downloads each file and re-hosts it. On other types they are not downloaded, but still count toward the limit of 6. Allowed MIME types: video/mp4, video/quicktime. Up to 20 MB per file, and up to 6 items total combined with images.
Response
The created task. The message you sent is returned as content and assignedTo as userId. A linkedin or whatsapp task comes back with its internal type, linkedinSend or whatsappMessage. priority comes back as a number (0, 1 or 2) and is omitted when empty.
A manual action assigned to a user to complete. Only the fields set on the task are returned.
Unique task identifier
Task type as stored, never null. Tasks created through the API use email, manual, phone, linkedinSend or whatsappMessage. Campaign tasks carry the type of their step (for example linkedinInvite, whatsappVoiceNote or sms), and reply and click tasks use opportunityReplied and opportunityClicked.
Task title
Task instruction, sent as message when the task is created or updated.
Text of the lead's LinkedIn reply, when it has one, on opportunityReplied tasks.
0 low, 1 medium, 2 high. Absent when the task has no priority.
0, 1, 2 Due date. Tasks carry no creation date.
ID of the assigned user, sent as assignedTo.
Associated lead ID
Associated contact ID
Campaign ID. A task on a lead carries the campaign of that lead.
Sequence ID
First name of the lead or contact
Last name of the lead or contact
Company name of the lead or contact. On a company task, the name (or domain) of the company, the only field that identifies it: the response carries no companyId.
true on tasks created by hand in lemlist or through the API, on campaign tasks whose step has its manual option on, and on out-of-office tasks. Absent otherwise, never false.
Was this page helpful?