Skip to main content
POST
Create 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.

Draft of message tasks

On email, 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 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. On other types, 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

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
recordId
string
required

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.

type
enum<string>
required

The type of task.

Available options:
email,
manual,
phone,
linkedin,
whatsapp
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). A date in the past is accepted: the task is created already due.

leadId
string
deprecated

Legacy name of recordId, still accepted for backward compatibility. Use recordId instead. When both are sent, leadId is used.

title
string
default:""

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

Maximum string length: 400
message
string
default:""

Optional 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.

Maximum string length: 32000
taskData
object

Draft of the message to send on email, linkedin and whatsapp tasks, and fallback number on phone tasks.

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. 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.

videos
string<uri>[]

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.

_id
string

Unique task identifier

type
string

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.

title
string

Task title

content
string

Task instruction, sent as message when the task is created or updated.

text
string

Text of the lead's LinkedIn reply, when it has one, on opportunityReplied tasks.

priority
enum<integer>

0 low, 1 medium, 2 high. Absent when the task has no priority.

Available options:
0,
1,
2
dueDate
string<date-time>

Due date. Tasks carry no creation date.

userId
string

ID of the assigned user, sent as assignedTo.

leadId
string

Associated lead ID

contactId
string

Associated contact ID

campaignId
string

Campaign ID. A task on a lead carries the campaign of that lead.

sequenceId
string

Sequence ID

leadFirstName
string

First name of the lead or contact

leadLastName
string

Last name of the lead or contact

leadCompanyName
string

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.

manual
boolean

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.