Create Draft
curl --request POST \
--url https://api.lemlist.com/api/inbox/{contactId}/drafts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "email",
"content": "<p>Hello John, I wanted to follow up on our conversation.</p>"
}
'import requests
url = "https://api.lemlist.com/api/inbox/{contactId}/drafts"
payload = {
"channel": "email",
"content": "<p>Hello John, I wanted to follow up on our conversation.</p>"
}
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({
channel: 'email',
content: '<p>Hello John, I wanted to follow up on our conversation.</p>'
})
};
fetch('https://api.lemlist.com/api/inbox/{contactId}/drafts', 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/inbox/{contactId}/drafts")
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 \"channel\": \"email\",\n \"content\": \"<p>Hello John, I wanted to follow up on our conversation.</p>\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/inbox/{contactId}/drafts",
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([
'channel' => 'email',
'content' => '<p>Hello John, I wanted to follow up on our conversation.</p>'
]),
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;
}{
"draftId": "drf_abc123def456789"
}Content must not be emptyThe authentication you supplied is incorrectInbox
Create Draft
Creates a new draft for a specific contact. The source is automatically set to “api”.
POST
/
inbox
/
{contactId}
/
drafts
Create Draft
curl --request POST \
--url https://api.lemlist.com/api/inbox/{contactId}/drafts \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "email",
"content": "<p>Hello John, I wanted to follow up on our conversation.</p>"
}
'import requests
url = "https://api.lemlist.com/api/inbox/{contactId}/drafts"
payload = {
"channel": "email",
"content": "<p>Hello John, I wanted to follow up on our conversation.</p>"
}
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({
channel: 'email',
content: '<p>Hello John, I wanted to follow up on our conversation.</p>'
})
};
fetch('https://api.lemlist.com/api/inbox/{contactId}/drafts', 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/inbox/{contactId}/drafts")
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 \"channel\": \"email\",\n \"content\": \"<p>Hello John, I wanted to follow up on our conversation.</p>\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/inbox/{contactId}/drafts",
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([
'channel' => 'email',
'content' => '<p>Hello John, I wanted to follow up on our conversation.</p>'
]),
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;
}{
"draftId": "drf_abc123def456789"
}Content must not be emptyThe authentication you supplied is incorrectThe
draftOwner query parameter is required and identifies the draft owner. It accepts either:- A userId (e.g.,
usr_abc123def456789) — used directly - A login email (e.g.,
john@acme.com) — resolved to userId via email lookup
contactOwner in the Lead API. Team membership is verified in both cases.Validations:
contentmust not be empty and has a max size of 30KB (30,000 characters)channelmust be one of:email,linkedin,whatsapp,sms- Maximum of 10 drafts per conversation
contentandsubjectare sanitized for security
Authorizations
Query Parameters
Body
application/json
Was this page helpful?