Update Draft
curl --request PATCH \
--url https://api.lemlist.com/api/inbox/{contactId}/drafts/{draftId} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "Updated subject",
"content": "<p>Updated content for the draft.</p>"
}
'import requests
url = "https://api.lemlist.com/api/inbox/{contactId}/drafts/{draftId}"
payload = {
"subject": "Updated subject",
"content": "<p>Updated content for the draft.</p>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({subject: 'Updated subject', content: '<p>Updated content for the draft.</p>'})
};
fetch('https://api.lemlist.com/api/inbox/{contactId}/drafts/{draftId}', 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/{draftId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"Updated subject\",\n \"content\": \"<p>Updated content for the draft.</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/{draftId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'subject' => 'Updated subject',
'content' => '<p>Updated content for the draft.</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;
}{
"draft": {
"_id": "drf_abc123def456789",
"channel": "email",
"subject": "Updated subject",
"cc": [],
"content": "<p>Updated content for the draft.</p>",
"attachments": [],
"source": "api",
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T11:00:00.000Z"
}
}"Content must not be empty""The authentication you supplied is incorrect""Draft not found"Inbox
Update Draft
Partially updates an existing draft. Only the provided fields will be updated.
PATCH
/
inbox
/
{contactId}
/
drafts
/
{draftId}
Update Draft
curl --request PATCH \
--url https://api.lemlist.com/api/inbox/{contactId}/drafts/{draftId} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "Updated subject",
"content": "<p>Updated content for the draft.</p>"
}
'import requests
url = "https://api.lemlist.com/api/inbox/{contactId}/drafts/{draftId}"
payload = {
"subject": "Updated subject",
"content": "<p>Updated content for the draft.</p>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({subject: 'Updated subject', content: '<p>Updated content for the draft.</p>'})
};
fetch('https://api.lemlist.com/api/inbox/{contactId}/drafts/{draftId}', 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/{draftId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"Updated subject\",\n \"content\": \"<p>Updated content for the draft.</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/{draftId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'subject' => 'Updated subject',
'content' => '<p>Updated content for the draft.</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;
}{
"draft": {
"_id": "drf_abc123def456789",
"channel": "email",
"subject": "Updated subject",
"cc": [],
"content": "<p>Updated content for the draft.</p>",
"attachments": [],
"source": "api",
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T11:00:00.000Z"
}
}"Content must not be empty""The authentication you supplied is incorrect""Draft not found"The
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:
- If
contentis provided, it must not be empty and has a max size of 30KB (30,000 characters) contentandsubjectare sanitized for securityupdatedAtis set automatically
Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Query Parameters
Draft owner identifier. Accepts either a userId (e.g., usr_abc123def456789) or a login email (e.g., john@acme.com).
Body
application/json
Response
Success
Show child attributes
Show child attributes
Was this page helpful?