Skip to main content
PUT
/
campaigns
/
{campaignId}
/
export
/
{exportId}
/
email
/
{email}
Set Email for Campaign Export Notification
curl --request PUT \
  --url https://api.lemlist.com/api/campaigns/{campaignId}/export/{exportId}/email/{email} \
  --header 'Authorization: Basic <encoded-value>'
{
  "ok": true,
  "status": {
    "_id": "axp_7dKLTwqpjxzR5vh2n",
    "id": "axp_7dKLTwqpjxzR5vh2n",
    "teamId": "tea_c123fg5h8ijKL9noP",
    "campaignId": "cam_A1B2C3D4E5F6G7H8I9",
    "campaignName": "Insights Outreach 2024",
    "status": "done",
    "startedAt": "2024-07-11T09:49:15.278Z",
    "progressIndex": 6,
    "progressTime": 1720691355497,
    "progressLastStepDuration": 0,
    "progressType": "done",
    "progress": 0,
    "total": 0,
    "fileSize": 654,
    "endedAt": "2024-07-11T09:49:15.497Z",
    "url": "https://api.lemlist.com/api/files/exports/fil_axp_7dKLTwqpjxzR5vh2n_insights_outreach_2024.csv",
    "email": "emily.johnson@example.com"
  }
}
This endpoint sets an email address to receive a notification when a campaign export is complete.

How it works

When you set an email address for an export:
  1. The export continues processing in the background
  2. When the export status becomes "done", an automated email is sent to the specified address
  3. The email contains the download URL for the CSV file

Use cases

This is particularly useful for:
  • Long-running exports: Set an email and continue working without having to poll the status endpoint
  • Automated workflows: Set up scripts that trigger exports and notify specific team members
  • Multiple recipients: Call this endpoint with different email addresses to notify multiple people
You can set the email notification at any time after starting an export, even if the export is already complete. However, it’s most useful to set it immediately after starting the export.

Email format

The notification email includes:
  • Campaign name
  • Export completion timestamp
  • Direct download link to the CSV file
Remember that the CSV file is only available for 24 hours after the export completes.

Authorizations

Authorization
string
header
required

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

Path Parameters

campaignId
string
required

The unique identifier of the campaign that was exported

exportId
string
required

The unique identifier of the export returned by the /start endpoint

email
string<email>
required

The email address to send the export URL to when the export is done

Response

Email notification set successfully

ok
boolean
status
object