{ "openapi": "3.0.0", "info": { "title": "lemlist API", "version": "1.0.0", "description": "Welcome to the lemlist Developer Documentation.\n\nlemlist is very customizable and open. You'll find on this page all the API and integration you can do with lemlist.\n\n# Rate Limit\n\nlemlist's API rate limits requests in order to prevent abuse and overload of our services. \nRate limits are applied on all routes and per API key performing the request. \nThe rate limits are **20** requests per **2** seconds. \nThe response provides any information you may need about it:\n\n| Header | Description |\n| --- | --- |\n| Retry-After | The number of seconds in which you can retry |\n| X-RateLimit-Limit | The maximum requests in that time |\n| X-RateLimit-Remaining | The number of remaining requests you can make |\n| X-RateLimit-Reset | The date when the rate limit will reset |\n\n_Example of values for the rate limit headers_\n\n``` json\n{\n \"Retry-After\": 2,\n \"X-RateLimit-Limit\": 20,\n \"X-RateLimit-Remaining\": 7,\n \"X-RateLimit-Reset\" : \"Tue Feb 16 2021 09:02:42 GMT+0100 (Central European Standard Time)\"\n}\n\n ```\n\n# Definitions\n\n## Team\n\nA team is the entity of lemlist that can handle users and billing.\n\n## Credits\n\nCredits are the coins a team uses to enrich emails, LinkedIn URLs, etc. via the enrich route. Each enrichment feature needs a certain amount of credits to run.\n\n## User\n\nYou use a user account to connect to lemlist and send messages via the connected emails or LinkedIn account.\n\n## Campaign\n\nA campaign is the entity to automate outreach. A campaign has multiple sequences composed of steps.\n\n## Lead\n\nA lead is a person that you try to contact via a campaign.\n\n## Activity\n\nAn activity is the history of all the steps.\n\n## Unsubscribe\n\nAn unsubscribe occurs when a person decides they don't want to receive emails from you anymore.\n\n# Authentication\n\nAll API routes use the dedicated subdomain `api.lemlist.com`.\n\nlemlist uses API keys to allow access to the API. You can get your lemlist API key at our [integration page](https://app.lemlist.com/settings/integrations).\n\nYou need to add the `Authorization` header using the `Basic` authentication type. `login:password` **where the login is always empty and the password is the API key**.\n\n⚠️ **Don't forget to add the semicolon (**`:`**) before your API key in curl command.**\n\n> To authorize, use this code: \n \n\n``` shell\ncurl https://api.lemlist.com/api/team \\\n --user \":YourApiKey\"\n\n ```\n\n**Make sure to replace** **`YourApiKey`** **with your API key.**\n\n# Give feedback\n\nIf you want to report a bug, ask for data, or share with us a use case, please fill this [form](https://lemlist.typeform.com/to/mfVlkyGf). It will help us centralize your needs!" }, "servers": [ { "url": "https://api.lemlist.com/api" } ], "security": [ { "basicAuth": [] } ], "components": { "securitySchemes": { "basicAuth": { "type": "http", "scheme": "basic" } }, "schemas": { "Team": { "type": "object", "description": "The organization account that manages users and billing.", "properties": { "_id": { "type": "string", "description": "Unique team identifier" }, "name": { "type": "string", "description": "Team name" }, "userIds": { "type": "array", "description": "User IDs in this team", "items": { "type": "string" } }, "createdBy": { "type": "string", "description": "User ID who created the team" }, "createdAt": { "type": "string", "format": "date-time", "description": "Date and time when the team was created" }, "hooks": { "type": "array", "description": "Webhooks configured for the team", "items": { "$ref": "#/components/schemas/Webhook" } }, "beta": { "type": "array", "description": "Beta features enabled for the team", "items": { "type": "string" } }, "slackWebhook": { "type": "object", "properties": { "url": { "type": "string", "format": "uri", "description": "Slack webhook URL for notifications" }, "failCounter": { "type": "integer", "description": "Number of consecutive failed notifications" } }, "description": "Slack webhooks configured for the team" }, "invitedUsers": { "type": "array", "description": "Pending user invitations", "items": { "type": "object", "properties": { "email": { "type": "string", "format": "email" }, "role": { "type": "string" }, "invitedBy": { "type": "string" }, "invitedAt": { "type": "string", "format": "date-time" } } } }, "agency": { "type": "string", "description": "Agency identifier if team is part of an agency" }, "pictureId": { "type": "string", "description": "Team profile picture file ID" }, "customDomain": { "type": "string", "description": "Custom domain for the team" }, "users": { "type": "array", "description": "Team members with their basic details. Only returned when the request includes the `version=v2` query parameter.", "items": { "type": "object", "properties": { "userId": { "type": "string", "description": "Unique user identifier" }, "name": { "type": "string", "description": "User's full name" }, "email": { "type": "string", "format": "email", "description": "User's primary email address" }, "role": { "type": "string", "description": "User's role in the team" } } } } } }, "Credits": { "type": "object", "description": "Credits are the coins a team uses to enrich emails, LinkedIn URLs, etc. Each enrichment feature needs a certain amount of credits to run.", "properties": { "credits": { "type": "integer", "description": "Total credits remaining" }, "details": { "type": "object", "properties": { "remaining": { "type": "object", "properties": { "total": { "type": "integer", "description": "Total credits remaining" }, "freemium": { "type": "integer", "description": "Freemium credits remaining" }, "subscription": { "type": "integer", "description": "Subscription credits remaining" }, "gifted": { "type": "integer", "description": "Gifted credits remaining" }, "paid": { "type": "integer", "description": "Paid credits remaining" } } } } } } }, "User": { "type": "object", "description": "A team member account with connected email and/or LinkedIn sending capabilities.", "properties": { "_id": { "type": "string", "description": "Unique user identifier" }, "email": { "type": "string", "format": "email", "description": "User email address" }, "role": { "type": "string", "description": "User role in the team (admin, member, etc.)" }, "linkedIn": { "type": "object", "description": "LinkedIn integration settings", "properties": { "linkedinUrl": { "type": "string", "description": "The LinkedIn URL of the person" }, "status": { "type": "boolean", "description": "Whether LinkedIn is connected" }, "inviteLimit": { "type": "integer", "description": "Daily limit for LinkedIn connection invites" }, "sendLimit": { "type": "integer", "description": "Daily limit for LinkedIn messages" }, "visitLimit": { "type": "integer", "description": "Daily limit for LinkedIn profile visits" } } }, "mailboxes": { "type": "array", "description": "Email mailboxes connected to this user", "items": { "$ref": "#/components/schemas/Mailbox" } } } }, "Campaign": { "type": "object", "description": "An automated outreach workflow containing sequences of steps.", "properties": { "_id": { "type": "string", "description": "Unique campaign identifier" }, "name": { "type": "string", "description": "Campaign name" }, "emoji": { "type": "string", "description": "Emoji shown next to the campaign name" }, "labels": { "type": "array", "description": "Categorization labels", "items": { "type": "string" } }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "createdBy": { "type": "string", "description": "Creator user ID" }, "status": { "type": "string", "description": "Campaign status", "enum": [ "running", "paused", "draft", "ended", "archived", "errors" ] }, "sequenceId": { "type": "string", "description": "Main sequence ID" }, "scheduleIds": { "type": "array", "description": "Associated schedule IDs", "items": { "type": "string" } }, "timezone": { "type": "string", "description": "IANA timezone the campaign schedule runs in (e.g. \"Europe/Paris\")" }, "teamId": { "type": "string", "description": "ID of the team that owns this campaign" }, "hasError": { "type": "boolean", "description": "Whether the campaign has errors" }, "errors": { "type": "array", "description": "List of error messages if campaign has errors", "items": { "type": "string" } }, "creator": { "type": "object", "description": "Campaign creator information", "properties": { "userId": { "type": "string", "description": "Creator user ID" }, "userEmail": { "type": "string", "format": "email", "description": "Creator email address" } } }, "senders": { "type": "array", "description": "Campaign senders configuration", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Sender user ID" }, "email": { "type": "string", "format": "email", "description": "Sender email address" }, "sendUserMailboxId": { "type": "string", "description": "Mailbox ID used for sending" } } } } } }, "Lead": { "type": "object", "description": "A contact added to a campaign for outreach. Not to be confused with a contact which is a record in lemlist, but not necessarily added to a campaign.", "properties": { "_id": { "type": "string", "description": "Unique lead identifier" }, "email": { "type": "string", "format": "email", "description": "Lead email address" }, "firstName": { "type": "string", "description": "First name" }, "lastName": { "type": "string", "description": "Last name" }, "companyName": { "type": "string", "description": "Company name" }, "phone": { "type": "string", "description": "Phone number" }, "linkedinUrl": { "type": "string", "format": "uri", "description": "LinkedIn profile URL" }, "picture": { "type": "string", "format": "uri", "description": "Profile picture URL" }, "icebreaker": { "type": "string", "description": "Personalized icebreaker text" }, "timezone": { "type": "string", "description": "Lead's timezone in IANA format (e.g., Europe/Paris, America/New_York)" }, "campaignId": { "type": "string", "description": "Campaign ID the lead belongs to" }, "campaignName": { "type": "string", "description": "Campaign name the lead belongs to" }, "isUnsubscribed": { "type": "boolean", "description": "Whether the lead is unsubscribed" } } }, "Activity": { "type": "object", "description": "A recorded action or event in a campaign sequence (email sent, opened, clicked, etc.).", "properties": { "_id": { "type": "string", "description": "Unique activity identifier" }, "type": { "type": "string", "description": "Activity type (emailOpened, emailClicked, emailReplied, etc.)" }, "leadId": { "type": "string", "description": "Associated lead ID" }, "campaignId": { "type": "string", "description": "Campaign ID" }, "sequenceId": { "type": "string", "description": "Sequence ID" }, "stepId": { "type": "string", "description": "Stable identifier of the sequence step that produced this activity. Present on every activity created from now on; older activities gain it progressively as historical records are backfilled, so treat it as optional when reading history." }, "sequenceStep": { "type": "number", "description": "0-based position of the step within the sequence. Still emitted on every activity, unchanged. Prefer `stepId` for a reference that survives steps being reordered." }, "totalSequenceStep": { "type": "number", "description": "0-based count of the sequence steps already delivered to this lead." }, "createdAt": { "type": "string", "format": "date-time", "description": "When the activity occurred" } } }, "Unsubscribe": { "type": "object", "description": "A record of someone opting out of receiving emails.", "properties": { "_id": { "type": "string", "description": "Unique unsubscribe identifier" }, "email": { "type": "string", "format": "email", "description": "Unsubscribed email address" }, "campaignId": { "type": "string", "description": "Campaign ID from which the person unsubscribed" }, "campaignName": { "type": "string", "description": "Campaign name from which the person unsubscribed" }, "unsubscribedAt": { "type": "string", "format": "date-time", "description": "Unsubscribe timestamp" }, "scope": { "type": "string", "description": "Unsubscribe scope", "enum": [ "campaign", "team", "global" ] } } }, "UnsubscribedVariable": { "type": "object", "description": "A variable (email, domain, LinkedIn URL, or phone number) that has been unsubscribed.", "properties": { "_id": { "type": "string", "description": "Unique identifier for the unsubscribe entry" }, "value": { "type": "string", "description": "The unsubscribed variable (email, domain, LinkedIn URL, or phone number)" }, "source": { "type": "string", "description": "Origin of the unsubscription", "enum": [ "api", "bounced", "lead", "user", "abuse" ] }, "createdAt": { "type": "string", "format": "date-time", "description": "When the variable was unsubscribed" } } }, "ContactSubscriptionStatus": { "type": "object", "description": "Subscription status of a contact.", "properties": { "_id": { "type": "string", "description": "Contact identifier" }, "doNotContact": { "type": "boolean", "description": "Whether the contact is unsubscribed" } } }, "Enrich": { "type": "object", "description": "Contact information discovered through data enrichment (emails, phone numbers, LinkedIn URLs).", "properties": { "_id": { "type": "string", "description": "Unique enrichment request identifier" }, "status": { "type": "string", "description": "Enrichment status", "enum": [ "pending", "completed", "failed" ] }, "email": { "type": "string", "format": "email", "description": "Found email address" }, "phone": { "type": "string", "description": "Found phone number" }, "firstName": { "type": "string", "description": "Found first name" }, "lastName": { "type": "string", "description": "Found last name" }, "companyName": { "type": "string", "description": "Found company name" }, "linkedinUrl": { "type": "string", "format": "uri", "description": "Found LinkedIn URL" }, "credits": { "type": "integer", "description": "Credits consumed" } } }, "Task": { "type": "object", "description": "A manual action assigned to a user to complete.", "properties": { "_id": { "type": "string", "description": "Unique task identifier" }, "type": { "type": "string", "description": "Task type" }, "leadId": { "type": "string", "description": "Associated lead ID" }, "campaignId": { "type": "string", "description": "Campaign ID" }, "userId": { "type": "string", "description": "Assigned user ID" }, "status": { "type": "string", "description": "Task status", "enum": [ "pending", "completed", "ignored" ] }, "dueDate": { "type": "string", "format": "date-time", "description": "Due date timestamp" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "completedAt": { "type": "string", "format": "date-time", "description": "Completion timestamp" } } }, "FieldRejection": { "type": "object", "description": "A value lemlist refused to write on a Contact or Company, with the reason why. Surfaced under `fieldRejections[]` on those objects; filter a list endpoint to only flagged records via the `fieldRejectionReason` query param.", "properties": { "field": { "type": "string", "description": "The record field the rejected value targeted (e.g. `emails`, `linkedinUrl`, `domain`)." }, "reason": { "type": "string", "description": "Why the value was rejected, prefixed by its origin — `enrichment_*` (raised while enriching) or `crm_sync_*` (raised during CRM sync). Same values accepted by the `fieldRejectionReason` query param." }, "source": { "type": "string", "description": "Where the rejection came from — an enrichment source (`lemrich`) or a CRM provider (`hubspot`, `salesforce`, `pipedrive`)." }, "conflictingRecordId": { "type": "string", "description": "For duplicate reasons, the id of the record that already holds the value — use it to merge or remap before resolving the duplicate. Omitted for non-duplicate reasons." }, "rejectedValue": { "type": "string", "description": "The value that was refused." }, "rejectedAt": { "type": "string", "format": "date-time", "description": "When the rejection was recorded." } } }, "Contact": { "type": "object", "description": "A contact record in your CRM. Not to be confused with a lead which is a contact specifically added to a campaign.", "properties": { "_id": { "type": "string", "description": "Unique contact identifier" }, "teamId": { "type": "string", "description": "Team identifier the contact belongs to" }, "fullName": { "type": "string", "description": "Contact's calculated full name" }, "email": { "type": "string", "format": "email", "description": "Contact's primary email address" }, "fields": { "type": "object", "description": "Custom fields associated with the contact", "additionalProperties": true }, "campaigns": { "type": "array", "description": "List of campaigns the contact is associated with", "items": { "type": "object", "properties": { "campaignId": { "type": "string" }, "campaignState": { "type": "string" }, "leadState": { "type": "string" }, "leadId": { "type": "string" } } } }, "ownerId": { "type": "string", "description": "ID of the user who owns this contact" }, "createdAt": { "type": "string", "format": "date-time", "description": "Contact creation timestamp" }, "createdBy": { "type": "string", "description": "ID of the user who created the contact" }, "unsubscribed": { "type": "boolean", "description": "Whether the contact is globally unsubscribed. When true, no outreach will be sent to this contact." }, "fieldRejections": { "type": "array", "description": "Values lemlist refused to write on this contact, each with its reason. Empty when none. Filter the list endpoint to only flagged contacts via `GET /contacts?fieldRejectionReason=...`.", "items": { "$ref": "#/components/schemas/FieldRejection" } } } }, "Company": { "type": "object", "description": "An organization record in your CRM.", "properties": { "_id": { "type": "string", "description": "Unique company identifier" }, "name": { "type": "string", "description": "Company name (may also be present under fields.name)" }, "domain": { "type": "string", "description": "Website domain" }, "industry": { "type": "string", "description": "Industry sector" }, "size": { "type": "string", "description": "Company size" }, "location": { "type": "string", "description": "Geographic location" }, "fields": { "type": "object", "description": "Flexible key/value fields of the company (e.g., name, picture, industry, location, size, foundedOn)", "additionalProperties": true }, "createdBy": { "type": "string", "description": "User ID who created the company" }, "ownerId": { "type": "string", "description": "User ID of the owner of the company" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "fieldRejections": { "type": "array", "description": "Values lemlist refused to write on this company, each with its reason. Empty when none. Filter the list endpoint to only flagged companies via `GET /companies?fieldRejectionReason=...`.", "items": { "$ref": "#/components/schemas/FieldRejection" } }, "crmSync": { "type": "object", "nullable": true, "description": "CRM sync status for the company, resolved against the team's active CRM provider (Hubspot, Salesforce, or Pipedrive). Only present when a CRM is connected. Use this block to monitor sync state and resolve duplicates (e.g. via `GET /companies?crmSyncStatus=unique_index_error_company`).", "properties": { "provider": { "type": "string", "enum": [ "hubspot", "salesforce", "pipedrive" ], "description": "Active CRM provider for the team." }, "crmRecordId": { "type": "string", "nullable": true, "description": "Identifier of the company record on the CRM side. `null` when the lemlist company has not been synced yet." }, "syncDisabled": { "type": "boolean", "description": "When `true`, automatic sync is paused for this company." }, "errors": { "type": "array", "description": "List of recent sync errors. Empty when the company is synced cleanly.", "items": { "type": "object", "properties": { "type": { "type": "string", "description": "Coarse error category (e.g. `CONNECT_FAILED`, `CREATE_FAILED`, `UPDATE_FAILED`)." }, "reason": { "type": "string", "description": "Specific error reason. Matches the lowercase form accepted by the `crmSyncStatus` query param (e.g. `UNIQUE_INDEX_ERROR_COMPANY`, `PROPERTY_DOESNT_EXIST`, `REQUIRED_FIELD_MISSING`)." }, "raisedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the error was last raised." }, "metadata": { "type": "object", "additionalProperties": true, "description": "Extra context. For `UNIQUE_INDEX_ERROR_COMPANY`, contains `alreadyExistingCompanyId` — the lemlist company that already occupies the conflicting CRM record. Use it to remap contacts onto the right lemlist company before deleting the duplicate." } } } } } } } }, "DatabaseCompany": { "type": "object", "description": "A company record from lemlist's People database.", "properties": { "company_id": { "type": "integer", "description": "Unique company identifier" }, "company_name": { "type": "string", "description": "Company name" }, "company_website_url": { "type": "string", "description": "Website URL" }, "company_employee_count": { "type": "integer", "description": "Employee count" }, "company_industry": { "type": "string", "description": "Industry sector" } } }, "CompanyNote": { "type": "object", "description": "A text note attached to a company record to store information.", "properties": { "_id": { "type": "string", "description": "Unique note identifier" }, "teamId": { "type": "string", "description": "Team ID that owns the company" }, "companyId": { "type": "string", "description": "Parent company ID" }, "note": { "type": "string", "description": "Note text content" }, "type": { "type": "string", "description": "Type of note or activity (e.g., 'annotated')" }, "userId": { "type": "string", "description": "ID of the user who created the note" }, "sendUserId": { "type": "string", "description": "ID of the sending user if applicable" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Last update timestamp" } } }, "Sequence": { "type": "object", "description": "An ordered series of steps within a campaign.", "properties": { "_id": { "type": "string", "description": "Unique sequence identifier" }, "campaignId": { "type": "string", "description": "Parent campaign ID" }, "steps": { "type": "array", "description": "Ordered list of steps", "items": { "$ref": "#/components/schemas/Step" } }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp" } } }, "Step": { "type": "object", "description": "A single action in a sequence (email, LinkedIn message, delay, task, etc.).", "properties": { "_id": { "type": "string", "description": "Unique step identifier" }, "sequenceId": { "type": "string", "description": "Parent sequence ID" }, "type": { "type": "string", "description": "Action type", "enum": [ "email", "linkedinInvite", "linkedinMessage", "linkedinVisit", "delay", "task", "api" ] }, "order": { "type": "integer", "description": "Position in sequence" }, "delay": { "type": "integer", "description": "Wait days before execution" }, "subject": { "type": "string", "description": "Email subject line" }, "body": { "type": "string", "description": "Message content" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "abTest": { "description": "A/B test state for this email step. `true` while the test runs (leads are split between variant A and B); `\"A\"` or `\"B\"` once a winner is selected (all remaining leads receive the winning template); absent/false when there is no A/B test.", "oneOf": [ { "type": "boolean" }, { "type": "string", "enum": [ "A", "B" ] } ] }, "emailTemplateId": { "type": "string", "description": "Email template ID of variant A" }, "emailTemplateBId": { "type": "string", "description": "Email template ID of variant B (present when an A/B test exists on the step)" } } }, "Schedule": { "type": "object", "description": "Sending time windows defining when campaigns can send messages (days and hours).", "properties": { "_id": { "type": "string", "description": "Unique schedule identifier" }, "name": { "type": "string", "description": "Schedule name" }, "secondsToWait": { "type": "integer", "description": "Seconds between sends" }, "timezone": { "type": "string", "description": "Schedule timezone (e.g., 'Europe/Paris')" }, "start": { "type": "string", "description": "Daily start time (HH:mm)", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" }, "end": { "type": "string", "description": "Daily end time (HH:mm)", "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" }, "weekdays": { "type": "array", "items": { "type": "integer", "minimum": 1, "maximum": 7 }, "description": "Active weekdays (1=Monday, 7=Sunday)" }, "public": { "type": "boolean", "description": "Whether the schedule is available as a template for other users" }, "teamId": { "type": "string", "description": "Unique identifier of the team that owns this schedule" }, "createdBy": { "type": "string", "description": "Unique identifier of the user who created this schedule" }, "createdAt": { "type": "string", "format": "date-time", "description": "Timestamp when the schedule was created" }, "deletedAt": { "type": "string", "format": "date-time", "description": "Timestamp when the schedule was deleted (only present if deleted)" }, "deletedBy": { "type": "string", "description": "Unique identifier of the user who deleted this schedule (only present if deleted)" } } }, "Webhook": { "type": "object", "description": "Webhooks send real-time HTTP notifications upon campaign events (opens, clicks, replies, etc.).", "properties": { "_id": { "type": "string", "description": "Unique webhook identifier" }, "targetUrl": { "type": "string", "format": "uri", "description": "Destination URL for event notifications" }, "type": { "type": "string", "description": "Event type to listen for. Events are grouped by category — see the endpoint docs for a full breakdown.", "enum": [ "contacted", "hooked", "attracted", "warmed", "interested", "notInterested", "emailsSent", "emailsOpened", "emailsClicked", "emailsReplied", "emailsBounced", "emailsFailed", "emailsInterested", "emailsNotInterested", "emailsUnsubscribed", "linkedinSent", "linkedinOpened", "linkedinReplied", "linkedinInterested", "linkedinNotInterested", "linkedinSendFailed", "linkedinVisitDone", "linkedinVisitFailed", "linkedinFollowDone", "linkedinFollowFailed", "linkedinFollowSkipped", "linkedinInviteDone", "linkedinInviteFailed", "linkedinInviteAccepted", "linkedinEndorseDone", "linkedinEndorseFailed", "linkedinEndorseSkipped", "linkedinVoiceNoteDone", "linkedinVoiceNoteFailed", "linkedinLikeLastPostDone", "linkedinLikeLastPostNoPost", "linkedinLikeLastPostFailed", "linkedinWithdrawInvitationDone", "linkedinWithdrawInvitationFailed", "whatsappMessageSent", "whatsappMessageDelivered", "whatsappMessageOpened", "whatsappReplied", "whatsappMessageFailed", "smsSent", "smsDelivered", "smsReplied", "smsFailed", "aircallCreated", "aircallEnded", "aircallDone", "aircallInterested", "aircallNotInterested", "apiDone", "apiInterested", "apiNotInterested", "apiFailed", "manualInterested", "manualNotInterested", "paused", "resumed", "stopped", "campaignComplete", "customDomainErrors", "connectionIssue", "sendLimitReached", "lemwarmPaused", "annotated", "enrichmentDone", "enrichmentError", "callRecordingDone", "callTranscriptDone", "inboxLabelUpdated", "signalRegistered", "deliverabilityAlertTriggered" ] }, "campaignId": { "type": "string", "description": "The ID of the campaign the webhook is associated with (if any)" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "zapId": { "type": "integer", "description": "Zapier integration ID (if the destination is a Zapier webhook)" } } }, "Report": { "type": "object", "description": "Aggregated campaign performance statistics (sent, opened, clicked, replied, etc.).", "properties": { "campaignId": { "type": "string", "description": "Campaign ID" }, "campaignName": { "type": "string", "description": "Campaign name" }, "stats": { "type": "object", "description": "Performance metrics", "properties": { "sent": { "type": "integer", "description": "Emails sent count" }, "opened": { "type": "integer", "description": "Emails opened count" }, "clicked": { "type": "integer", "description": "Links clicked count" }, "replied": { "type": "integer", "description": "Replies received count" }, "bounced": { "type": "integer", "description": "Bounced emails count" }, "interested": { "type": "integer", "description": "Interested leads count" } } }, "exportStatus": { "type": "string", "description": "Export request status", "enum": [ "pending", "done", "error" ] } } }, "Mailbox": { "type": "object", "description": "An email account connected to a user for sending campaigns.", "properties": { "_id": { "type": "string", "description": "Unique mailbox identifier" }, "email": { "type": "string", "format": "email", "description": "Mailbox email address" }, "provider": { "type": "string", "description": "Email provider (google, microsoft, etc.)" }, "status": { "type": "string", "description": "Connection status", "enum": [ "CONNECTED", "ERROR", "DISCONNECTED" ] }, "lemlist": { "type": "object", "properties": { "emailLimit": { "type": "integer", "description": "Daily send limit" } } }, "lemwarm": { "type": "object", "properties": { "active": { "type": "boolean", "description": "Lemwarm activation status" } } } } }, "ScheduleListResponse": { "type": "object", "description": "Paginated response containing multiple schedules.", "properties": { "schedules": { "type": "array", "description": "Array of schedule objects", "items": { "$ref": "#/components/schemas/Schedule" } }, "pagination": { "type": "object", "description": "Pagination information", "properties": { "totalRecords": { "type": "integer", "description": "Total number of schedules across all pages" }, "currentPage": { "type": "integer", "description": "Current page number" }, "nextPage": { "type": "integer", "description": "Next page number (null if on last page)" }, "totalPage": { "type": "integer", "description": "Total number of pages" } } } } }, "LeadListResponse": { "type": "object", "description": "Paginated response containing multiple leads.", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/Lead" } }, "page": { "type": "integer" }, "total": { "type": "integer" } } }, "CrmFilter": { "type": "object", "description": "A filter used in the CRM to segment leads or companies.", "properties": { "_id": { "type": "string" }, "name": { "type": "string" }, "type": { "type": "string" }, "criteria": { "type": "object", "additionalProperties": true } } }, "InboxConversation": { "type": "object", "description": "A message thread between a user and a contact in the inbox.", "properties": { "_id": { "type": "string" }, "leadId": { "type": "string" }, "messages": { "type": "array", "items": { "$ref": "#/components/schemas/InboxMessage" } }, "createdAt": { "type": "string", "format": "date-time" } } }, "InboxConversationPagination": { "type": "object", "description": "Paginated response containing multiple inbox conversations.", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/InboxConversation" } }, "page": { "type": "integer" }, "total": { "type": "integer" } } }, "InboxMessage": { "type": "object", "description": "A single message within an inbox conversation.", "properties": { "_id": { "type": "string" }, "conversationId": { "type": "string" }, "sender": { "type": "string" }, "recipient": { "type": "string" }, "body": { "type": "string" }, "sentAt": { "type": "string", "format": "date-time" } } }, "InboxMessagePagination": { "type": "object", "description": "Paginated response containing multiple inbox messages.", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/InboxMessage" } }, "page": { "type": "integer" }, "total": { "type": "integer" } } }, "Label": { "type": "object", "description": "A label used to categorize and organize inbox conversations.", "properties": { "_id": { "type": "string", "description": "Unique label identifier" }, "name": { "type": "string", "description": "Label name" }, "color": { "type": "string", "description": "Hex color code for the label" }, "createdAt": { "type": "string", "format": "date-time", "description": "Date and time when the label was created", "nullable": true }, "createdBy": { "type": "string", "description": "Email of the user who created the label", "nullable": true } } }, "TaskListResponse": { "type": "object", "description": "Paginated response containing multiple tasks.", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/Task" } }, "page": { "type": "integer" }, "total": { "type": "integer" } } }, "DatabaseFilter": { "type": "object", "description": "Saved search criteria for querying the People database.", "properties": { "_id": { "type": "string" }, "name": { "type": "string" }, "criteria": { "type": "object", "additionalProperties": true } } }, "PeopleSchema": { "type": "object", "description": "A person record from lemlist's People database.", "additionalProperties": true, "properties": { "lead_id": { "type": "integer", "description": "Numeric identifier for the person in the People database" }, "canonical_shorthand_name": { "type": "string" }, "connections_count": { "type": "integer" }, "country": { "type": "string" }, "full_name": { "type": "string" }, "education": { "type": "array", "items": { "type": "object", "additionalProperties": true, "properties": { "activities_and_societies": { "type": "string" }, "created": { "type": "string" }, "date_from": { "type": "string" }, "date_to": { "type": "string" }, "deleted": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "last_updated": { "type": "string" }, "member_id": { "type": "string" }, "school_url": { "type": "string", "format": "uri" }, "subtitle": { "type": "string" }, "title": { "type": "string" } } } }, "experience_count": { "type": "integer" }, "experiences": { "type": "array", "items": { "type": "object", "additionalProperties": true, "properties": { "company_id": { "type": "integer" }, "company_description": { "type": "string" }, "company_employee_count": { "type": "integer" }, "company_followers_count": { "type": "integer" }, "company_founded": { "type": "integer" }, "company_headquarters_city": { "type": "string" }, "company_headquarters_country": { "type": "string" }, "company_industry": { "type": "string" }, "company_linkedin_url": { "type": "string", "format": "uri" }, "company_logo_url": { "type": "string", "format": "uri" }, "company_name": { "type": "string" }, "company_size": { "type": "string" }, "company_type": { "type": "string" }, "company_url": { "type": "string" }, "company_website_url": { "type": "string", "format": "uri" }, "revenue_bucket": { "type": "string" }, "company_domain": { "type": "string" }, "employees_count_growth": { "type": "integer" }, "last_funding_round_at": { "type": "string" }, "business_business_customer": { "type": "string" }, "current_exp_bucket": { "type": "string" }, "created": { "type": "string" }, "date_from": { "type": "string" }, "date_to": { "type": "string" }, "description": { "type": "string" }, "duration": { "type": "string" }, "id": { "type": "string" }, "last_updated": { "type": "string" }, "location": { "type": "string" }, "member_id": { "type": "string" }, "order_in_profile": { "type": "integer" }, "title": { "type": "string" }, "title_normalized": { "type": "string" }, "main_in_profile": { "type": "boolean" } } } }, "interests": { "type": "array", "items": { "type": "object", "properties": { "interest": { "type": "string" }, "interest_id": { "type": "string" } } } }, "languages": { "type": "array", "items": { "type": "object", "properties": { "language": { "type": "string" }, "proficiency": { "type": "string" } } } }, "last_updated": { "type": "string" }, "lead_industry": { "type": "string" }, "lead_linkedin_url": { "type": "string", "format": "uri" }, "lead_logo_url": { "type": "string", "format": "uri" }, "linkedin_short": { "type": "string" }, "location": { "type": "string" }, "skills": { "type": "array", "items": { "type": "object", "properties": { "skill": { "type": "string" }, "skill_id": { "type": "string" } } } }, "summary": { "type": "string" }, "title": { "type": "string" }, "lead_quality_score": { "type": "integer" }, "seniority": { "type": "string" }, "department": { "type": "string" }, "connections_count_bucket": { "type": "string" }, "years_of_exp_bucket": { "type": "string" }, "current_exp_company_name": { "type": "string" }, "geopoint": { "type": "array", "items": { "type": "number" }, "minItems": 2, "maxItems": 2 }, "_score": { "type": "number" }, "_id": { "type": "string" } } }, "CompaniesSchema": { "type": "object", "description": "A company record from lemlist's Companies database.", "additionalProperties": true, "properties": { "company_id": { "type": "string", "description": "Unique company identifier" }, "company_website_url": { "type": "string", "format": "uri", "description": "Official company website URL" }, "company_name": { "type": "string", "description": "Company name" }, "company_linkedin_url": { "type": "string", "format": "uri", "description": "LinkedIn company profile URL" }, "last_updated": { "type": "string", "description": "Last update timestamp (UTC)" }, "company_headquarters_city": { "type": "string", "description": "Headquarters city" }, "company_headquarters_country": { "type": "string", "description": "Headquarters country" }, "company_logo_url": { "type": "string", "format": "uri", "description": "Company logo image URL" }, "company_description": { "type": "string", "description": "Long company description" }, "company_employee_count": { "type": "string", "description": "Employee count as string" }, "company_type": { "type": "string", "description": "Company type (e.g., Privately Held, Public Company)" }, "company_founded": { "type": "string", "description": "Year founded as string" }, "company_followers_count": { "type": "string", "description": "LinkedIn followers count as string" }, "company_size": { "type": "string", "description": "Company size bucket" }, "revenue_bucket": { "type": "string", "description": "Revenue range bucket" }, "company_domain": { "type": "string", "description": "Company web domain" }, "employees_count_growth": { "type": "integer", "description": "Employee count growth number" }, "last_funding_round_at": { "type": "string", "description": "Date of last funding round" }, "techno_used_array": { "type": "array", "items": { "type": "string" }, "description": "Array of technologies used by the company" }, "business_business_customer": { "type": "string", "description": "Customer type", "enum": [ "B2B", "B2C", "B2B2C" ] }, "company_quality_score": { "type": "string", "description": "Quality score as string" }, "company_industry": { "type": "string", "description": "Primary industry" }, "company_subindustry": { "type": "string", "description": "Sub-industry" }, "company_subsubindustry": { "type": "string", "description": "Sub-sub-industry" }, "company_location": { "type": "string", "description": "Full formatted location" }, "company_location_geopoint_array": { "type": "array", "items": { "type": "number" }, "description": "Geopoint coordinates [longitude, latitude]" }, "company_occ_lead": { "type": "string", "description": "Occupational lead count as string" }, "_score": { "type": "number", "description": "Search relevance score" }, "_id": { "type": "string", "description": "Internal document ID" } } }, "Persona": { "type": "object", "description": "A People Database persona: a named, reusable set of People Database filters saved by your team. A persona id can be referenced elsewhere in the API, for example through the `persona` filter of a Signal Agent.", "properties": { "_id": { "type": "string", "description": "Unique persona identifier", "example": "pdp_ExAmPlE1234567890a" }, "name": { "type": "string", "description": "Display name. Unique within your team.", "example": "SaaS founders" }, "mode": { "type": "string", "description": "Search mode the filters target", "enum": ["leads", "companies"], "example": "leads" }, "filters": { "type": "array", "description": "People Database filters defining the persona", "items": { "$ref": "#/components/schemas/PersonaFilter" } }, "createdAt": { "type": "string", "format": "date-time", "description": "Date the persona was created", "example": "2026-07-31T09:12:00.000Z" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Date of the last modification", "example": "2026-07-31T09:12:00.000Z" } } }, "PersonaFilter": { "type": "object", "description": "One People Database filter of a persona. `in` includes matching values, `out` excludes them. There is no `type` property: it is derived from `filterId` server-side.", "required": ["filterId"], "properties": { "filterId": { "type": "string", "description": "People Database filter identifier. Use [Get Database Filters](/api-reference/endpoints/people-database/get-database-filters) to discover the valid ids.", "example": "currentTitle" }, "in": { "type": "array", "description": "Values to include", "items": { "type": "string" }, "example": ["Founder"] }, "out": { "type": "array", "description": "Values to exclude", "items": { "type": "string" }, "example": [] }, "exactMatch": { "type": "boolean", "description": "Exact-match toggle, for the text filters that support it" } } }, "PersonaListResponse": { "type": "object", "properties": { "data": { "type": "array", "description": "The team's personas, most recently created first", "items": { "$ref": "#/components/schemas/Persona" } } } }, "PersonaCreateResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "_id": { "type": "string", "description": "Id of the created persona", "example": "pdp_ExAmPlE1234567890a" } } } } }, "PersonaDeleteResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "_id": { "type": "string", "description": "Id of the deleted persona", "example": "pdp_ExAmPlE1234567890a" }, "deleted": { "type": "boolean", "description": "Always `true` when the persona was removed", "example": true } } } } }, "PersonaError": { "type": "object", "description": "Error envelope returned by the persona endpoints.", "properties": { "error": { "type": "string", "description": "Human-readable explanation of the failure" }, "code": { "type": "string", "description": "Machine-readable error code, stable across releases" } } }, "LemwarmSettings": { "type": "object", "description": "Lemwarm configuration for a mailbox.", "properties": { "active": { "type": "boolean" }, "dailyLimit": { "type": "integer" }, "warmupTemplate": { "type": "string" }, "warmDailyVarianceEnabled": { "type": "boolean", "description": "Whether a random daily variance is applied to the warmup email target" }, "deliverability": { "type": "object", "properties": { "score": { "type": "integer" }, "lastAt": { "type": "string", "format": "date-time", "description": "Timestamp of last deliverability check" } } } } }, "SignalSchema": { "type": "object", "description": "A signal detected by a Signal Agent representing a tracked event (hiring, LinkedIn activity, website visit, etc.)", "required": [ "_id", "teamId", "watchListId", "type", "status", "receivedAt", "createdAt", "signalData" ], "properties": { "_id": { "type": "string", "description": "Unique signal identifier" }, "teamId": { "type": "string", "description": "Team ID that owns this signal" }, "watchListId": { "type": "string", "description": "ID of the Signal Agent associated with this signal" }, "watchListName": { "type": "string", "description": "Name of the Signal Agent associated with this signal" }, "type": { "type": "string", "description": "Signal type", "enum": [ "companyIsHiring", "companyRaisedFunds", "recruitmentCampaign", "jobChange", "newHire", "companyEmployeeVisitedMyWebsite", "customSignals", "competitorConnections", "competitorReactions", "companyFollowers", "technologyChange", "linkedinPeopleProfile", "linkedinCompanyProfile", "mergersAcquisitions", "promotion", "linkedinKeywords", "externalSignalContact", "externalSignalCompany", "buyingIntent" ] }, "status": { "type": "string", "description": "Signal status (computed based on user actions)", "enum": [ "new", "old", "handled", "ignored" ] }, "receivedAt": { "type": "string", "format": "date-time", "description": "When the signal was received" }, "createdAt": { "type": "string", "format": "date-time", "description": "When the signal was created in the database" }, "contact": { "type": "object", "description": "Contact associated with this signal (if entity type is 'contact')", "properties": { "_id": { "type": "string", "description": "Contact ID" }, "firstName": { "type": "string", "description": "Contact first name" }, "lastName": { "type": "string", "description": "Contact last name" }, "email": { "type": "string", "description": "Contact primary email" }, "jobTitle": { "type": "string", "description": "Contact job title" }, "phone": { "type": "string", "description": "Contact phone number" }, "linkedinUrl": { "type": "string", "description": "Contact LinkedIn profile URL" }, "picture": { "type": "string", "description": "Contact profile picture URL" } } }, "company": { "type": "object", "description": "Company associated with this signal", "properties": { "_id": { "type": "string", "description": "Company ID" }, "name": { "type": "string", "description": "Company name" }, "domain": { "type": "string", "description": "Company website domain" }, "linkedinUrl": { "type": "string", "description": "Company LinkedIn URL" }, "industry": { "type": "string", "description": "Company industry" }, "picture": { "type": "string", "description": "Company logo URL" } } }, "signalData": { "type": "object", "description": "Signal-specific data that varies by signal type. Each field is prefixed with the signal type(s) that populate it.", "properties": { "jobTitle": { "type": "string", "description": "[companyIsHiring] Job posting title" }, "jobDescription": { "type": "string", "description": "[companyIsHiring] Job posting description" }, "jobLocation": { "type": "string", "description": "[companyIsHiring] Job posting location" }, "jobUrl": { "type": "string", "description": "[companyIsHiring] Job posting URL" }, "jobStatus": { "type": "string", "description": "[companyIsHiring] Job posting status" }, "recruiterName": { "type": "string", "description": "[companyIsHiring] Recruiter name" }, "recruiterTitle": { "type": "string", "description": "[companyIsHiring] Recruiter title" }, "recruiterLinkedinUrl": { "type": "string", "description": "[companyIsHiring] Recruiter LinkedIn URL" }, "recruiterEmail": { "type": "string", "description": "[companyIsHiring] Recruiter email" }, "websiteVisited": { "type": "string", "description": "[companyEmployeeVisitedMyWebsite] Page URL that was visited" }, "visitorWebsite": { "type": "string", "description": "[companyEmployeeVisitedMyWebsite] Visitor's company website" }, "visitorCountry": { "type": "string", "description": "[companyEmployeeVisitedMyWebsite] Visitor country" }, "visitorDuration": { "type": "integer", "description": "[companyEmployeeVisitedMyWebsite] Visit duration in seconds (session-cumulative)" }, "startDate": { "type": "string", "description": "[jobChange/newHire/competitorConnections/companyFollowers] Start date at the tracked company" }, "previousCompany": { "type": "string", "description": "[jobChange] Previous company name" }, "previousCompanyLinkedinUrl": { "type": "string", "description": "[jobChange] Previous company LinkedIn URL" }, "trackedCompanyUrl": { "type": "string", "description": "Tracked company LinkedIn URL (competitorConnections, companyFollowers, ...)" }, "linkedinPeopleProfilePostUrl": { "type": "string", "description": "[linkedinPeopleProfile] Post URL" }, "linkedinPeopleProfilePostContent": { "type": "string", "description": "[linkedinPeopleProfile] Post content" }, "linkedinPeopleProfilePostCreatorName": { "type": "string", "description": "[linkedinPeopleProfile] Post creator name" }, "linkedinPeopleProfileType": { "type": "string", "description": "[linkedinPeopleProfile] Activity type (post, comment, like)" }, "linkedinPeopleProfileMentionContent": { "type": "string", "description": "[linkedinPeopleProfile] Mention content" }, "linkedinPeopleProfileTrackedContactUrl": { "type": "string", "description": "[linkedinPeopleProfile] Tracked contact LinkedIn URL" }, "linkedinPeopleProfileDate": { "type": "string", "description": "[linkedinPeopleProfile] Activity date" }, "linkedinCompanyProfilePostUrl": { "type": "string", "description": "[linkedinCompanyProfile] Post URL" }, "linkedinCompanyProfilePostContent": { "type": "string", "description": "[linkedinCompanyProfile] Post content" }, "linkedinCompanyProfilePostCreatorName": { "type": "string", "description": "[linkedinCompanyProfile] Post creator name" }, "linkedinCompanyProfileType": { "type": "string", "description": "[linkedinCompanyProfile] Activity type" }, "linkedinCompanyProfileMentionContent": { "type": "string", "description": "[linkedinCompanyProfile] Mention content" }, "linkedinCompanyProfileTrackedCompanyUrl": { "type": "string", "description": "[linkedinCompanyProfile] Tracked company LinkedIn URL" }, "linkedinCompanyProfileDate": { "type": "string", "description": "[linkedinCompanyProfile] Activity date" }, "linkedinKeywordsPostUrl": { "type": "string", "description": "[linkedinKeywords] Post URL" }, "linkedinKeywordsPostContent": { "type": "string", "description": "[linkedinKeywords] Post content" }, "linkedinKeywordsPostCreatorName": { "type": "string", "description": "[linkedinKeywords] Post creator name" }, "linkedinKeywordsType": { "type": "string", "description": "[linkedinKeywords] Activity type" }, "linkedinKeywordsMentionContent": { "type": "string", "description": "[linkedinKeywords] Mention content" }, "linkedinKeywordsMatchedKeywords": { "type": "string", "description": "[linkedinKeywords] Matched keywords" }, "linkedinKeywordsLocation": { "type": "string", "description": "[linkedinKeywords] Location" }, "linkedinKeywordsDate": { "type": "string", "description": "[linkedinKeywords] Activity date" }, "linkedinKeywordsPostCreatorUrl": { "type": "string", "description": "[linkedinKeywords] Post creator LinkedIn URL" }, "linkedinKeywordsPostCreatorCompanyUrl": { "type": "string", "description": "[linkedinKeywords] Post creator company LinkedIn URL" }, "customSignalTitle": { "type": "string", "description": "[customSignals] Signal title" }, "customSignalQuestion": { "type": "string", "description": "[customSignals] Question asked" }, "customSignalAnswer": { "type": "string", "description": "[customSignals] Short answer" }, "customSignalConfidence": { "type": "number", "description": "[customSignals] Confidence score" }, "customSignalLongAnswer": { "type": "string", "description": "[customSignals] Detailed answer" }, "customSignalHeadlines": { "type": "string", "description": "[customSignals] Headlines" }, "customSignalSources": { "type": "string", "description": "[customSignals] Sources" }, "fundingType": { "type": "string", "description": "[companyRaisedFunds] Funding type" }, "fundingStage": { "type": "string", "description": "[companyRaisedFunds] Funding stage" }, "fundingAmountUsd": { "type": "number", "description": "[companyRaisedFunds] Amount raised (USD)" }, "fundingAmountNative": { "type": "number", "description": "[companyRaisedFunds] Amount raised (native currency)" }, "fundingCurrency": { "type": "string", "description": "[companyRaisedFunds] Native currency" }, "fundingInvestors": { "type": "string", "description": "[companyRaisedFunds] Investors" }, "fundingSourceUrl": { "type": "string", "description": "[companyRaisedFunds] Source URL" }, "buyingIntentTopics": { "type": "string", "description": "[buyingIntent] Matched topics" }, "buyingIntentTopTopic": { "type": "string", "description": "[buyingIntent] Top matched topic" }, "competitorReactionsTrackedContactUrl": { "type": "string", "description": "[competitorReactions] Tracked contact LinkedIn URL" }, "competitorReactionsPostUrl": { "type": "string", "description": "[competitorReactions] Post URL" }, "competitorReactionsPostContent": { "type": "string", "description": "[competitorReactions] Post content" }, "competitorReactionsPostCreatorName": { "type": "string", "description": "[competitorReactions] Post creator name" }, "competitorReactionsEngagementType": { "type": "string", "description": "[competitorReactions] Engagement type (like, comment)" }, "competitorReactionsMentionContent": { "type": "string", "description": "[competitorReactions] Mention content" }, "competitorReactionsDate": { "type": "string", "description": "[competitorReactions] Engagement date" }, "acquisitionType": { "type": "string", "description": "[mergersAcquisitions] Acquisition type" }, "acquirerName": { "type": "string", "description": "[mergersAcquisitions] Acquirer name" }, "acquirerWebsite": { "type": "string", "description": "[mergersAcquisitions] Acquirer website" }, "acquireeName": { "type": "string", "description": "[mergersAcquisitions] Acquiree name" }, "acquireeWebsite": { "type": "string", "description": "[mergersAcquisitions] Acquiree website" }, "dealPriceUsd": { "type": "number", "description": "[mergersAcquisitions] Deal price (USD)" }, "dealCurrency": { "type": "string", "description": "[mergersAcquisitions] Deal currency" }, "announcementDate": { "type": "string", "description": "[mergersAcquisitions] Announcement date" }, "acquirerCrunchbaseUrl": { "type": "string", "description": "[mergersAcquisitions] Acquirer Crunchbase URL" }, "acquireeCrunchbaseUrl": { "type": "string", "description": "[mergersAcquisitions] Acquiree Crunchbase URL" }, "technologyChangeName": { "type": "string", "description": "[technologyChange] Technology name" }, "technologyChangeSourceType": { "type": "string", "description": "[technologyChange] Source type" }, "technologyChangeFirstSeenAt": { "type": "string", "description": "[technologyChange] First seen at" }, "technologyChangeLastSeenAt": { "type": "string", "description": "[technologyChange] Last seen at" }, "technologyChangeCompanyName": { "type": "string", "description": "[technologyChange] Company name" }, "technologyChangeCompanyDomain": { "type": "string", "description": "[technologyChange] Company domain" }, "promotionJobTitle": { "type": "string", "description": "[promotion] New job title" }, "promotionFormerJobTitle": { "type": "string", "description": "[promotion] Former job title" }, "promotionStartDate": { "type": "string", "description": "[promotion] Promotion start date" }, "externalSignalCustomFields": { "type": "object", "description": "[externalSignalContact/externalSignalCompany] Custom fields map", "additionalProperties": { "type": "string" } } } } } }, "WatchListApiFetchSignalsResponse": { "type": "object", "description": "Paginated response containing signals detected by Signal Agents", "properties": { "data": { "type": "array", "description": "Signals matching the query parameters", "items": { "$ref": "#/components/schemas/SignalSchema" } }, "meta": { "$ref": "#/components/schemas/WatchListListMeta" } } }, "WatchListSchema": { "type": "object", "description": "A Signal Agent (watch list) configuration.", "properties": { "_id": { "type": "string", "description": "Unique Signal Agent identifier" }, "name": { "type": "string", "description": "Display name" }, "type": { "type": "string", "description": "Signal type monitored by this Signal Agent", "enum": [ "companyIsHiring", "companyRaisedFunds", "recruitmentCampaign", "jobChange", "newHire", "companyEmployeeVisitedMyWebsite", "customSignals", "competitorConnections", "competitorReactions", "companyFollowers", "technologyChange", "linkedinPeopleProfile", "linkedinCompanyProfile", "mergersAcquisitions", "promotion", "linkedinKeywords", "externalSignalContact", "externalSignalCompany", "buyingIntent" ] }, "status": { "type": "string", "description": "Lifecycle status", "enum": [ "active", "inactive", "draft", "insufficient_credits", "empty_crm_lists", "error", "delete" ] }, "entity": { "type": "string", "description": "Entity kind the agent tracks", "enum": [ "contact", "company" ] }, "segmentType": { "type": "string", "description": "How the monitored entities are sourced", "enum": [ "all", "list", "csv" ] }, "signalProcessingType": { "type": "string", "description": "How detected signals are processed", "enum": [ "manual", "create_opportunity", "push_to_campaign" ] }, "signalOpportunityTemplate": { "type": "object", "description": "Task/opportunity template applied to each signal when signalProcessingType is create_opportunity.", "properties": { "ownerType": { "type": "string", "description": "Who the created opportunity is assigned to", "enum": [ "contact_owner", "specific_owner" ] }, "ownerId": { "type": "string", "description": "Owner user id, when ownerType is specific_owner" }, "type": { "type": "string", "description": "Opportunity channel", "enum": [ "email", "phone", "linkedinSend", "whatsappMessage", "manual" ] }, "priority": { "type": "integer", "description": "Opportunity priority", "enum": [ 0, 1, 2 ] }, "data": { "type": "object", "properties": { "title": { "type": "string", "description": "Opportunity title" }, "subject": { "type": "string", "description": "Email subject (email channel)" }, "emailTemplateId": { "type": "string", "description": "Email template id" }, "message": { "type": "string", "description": "Message body" } } } } }, "filters": { "type": "array", "description": "Filters narrowing which entities/events are tracked", "items": { "$ref": "#/components/schemas/WatchListFilter" } }, "emoji": { "type": "string", "description": "Emoji shown next to the agent name" } } }, "WatchListFilter": { "type": "object", "description": "A filter narrowing which entities or events a Signal Agent tracks. `in` includes matching values, `out` excludes them.", "required": [ "filterId" ], "properties": { "filterId": { "type": "string", "description": "Filter identifier", "enum": [ "title", "description", "location", "visitLocation", "website", "pagesTracked", "minVisitDuration", "minPageViewed", "internalTraffic", "linkedinUrls", "companyLinkedinUrls", "companyNames", "companyLocation", "companyIndustries", "companySizes", "maxIdentificationsPerDay", "excludedVisitorIps", "reactionTypes", "linkedinTopics", "bomboraTopics", "watcherWatchKey", "questions", "fundraisingMinAmount", "fundraisingMaxAmount", "fundraisingInvestmentTypes", "fundraisingInvestors", "technologies", "detectionMode", "maDealTypes", "maMinAmount", "persona", "externalSignalFieldMapping", "externalSignalCustomFieldMapping", "seniority", "crmListIds", "minJobCount", "timeframe" ] }, "in": { "type": "array", "description": "Values to include", "items": { "type": "string" } }, "out": { "type": "array", "description": "Values to exclude", "items": { "type": "string" } } } }, "WatchListListMeta": { "type": "object", "properties": { "pagination": { "type": "object", "properties": { "page": { "type": "integer", "description": "Current page number" }, "limit": { "type": "integer", "description": "Number of records per page" }, "totalRecords": { "type": "integer", "description": "Total records matching the filter" }, "totalPages": { "type": "integer", "description": "Total number of pages" } } } } }, "WatchListConfigHistoryEntry": { "type": "object", "description": "A past configuration version of a Signal Agent, active during [startDate, endDate).", "properties": { "_id": { "type": "string", "description": "History entry identifier" }, "startDate": { "type": "string", "description": "When this configuration version became active", "format": "date-time" }, "endDate": { "type": "string", "description": "When this configuration version was replaced", "format": "date-time" }, "createdBy": { "type": "string", "description": "User id that made the change" }, "name": { "type": "string", "description": "Signal Agent name at capture time" }, "emoji": { "type": "string", "description": "Emoji at capture time" }, "type": { "type": "string", "description": "Signal type", "enum": [ "companyIsHiring", "companyRaisedFunds", "recruitmentCampaign", "jobChange", "newHire", "companyEmployeeVisitedMyWebsite", "customSignals", "competitorConnections", "competitorReactions", "companyFollowers", "technologyChange", "linkedinPeopleProfile", "linkedinCompanyProfile", "mergersAcquisitions", "promotion", "linkedinKeywords", "externalSignalContact", "externalSignalCompany", "buyingIntent" ] }, "entity": { "type": "string", "description": "Entity kind", "enum": [ "contact", "company" ] }, "segmentType": { "type": "string", "description": "Segment sourcing", "enum": [ "all", "list", "csv" ] }, "filters": { "type": "array", "items": { "$ref": "#/components/schemas/WatchListFilter" } }, "signalProcessingType": { "type": "string", "description": "Signal processing type", "enum": [ "manual", "create_opportunity", "push_to_campaign" ] }, "stats": { "type": "object", "description": "Signal/campaign stats computed for the window [startDate, endDate).", "properties": { "signalsCount": { "type": "integer", "description": "Number of signals detected in the window" }, "campaigns": { "type": "array", "description": "Per-campaign breakdown (push_to_campaign agents only)", "items": { "type": "object" } } } } } }, "WatchListFilterDescriptor": { "type": "object", "description": "Describes a filter that can be set on a Signal Agent of a given type.", "properties": { "filterId": { "type": "string", "description": "Filter identifier" }, "name": { "type": "string", "description": "Human-readable filter name" }, "properties": { "type": "array", "description": "Filter sides supported by this filter", "items": { "type": "string", "enum": [ "in", "out" ] } }, "required": { "type": "array", "description": "Filter sides that must be non-empty", "items": { "type": "string", "enum": [ "in", "out" ] } }, "default": { "description": "Default value, when the filter has one" }, "min": { "type": "number", "description": "Minimum value (numeric filters)" }, "max": { "type": "number", "description": "Maximum value (numeric filters)" } } }, "WatchListLibraryEntry": { "type": "object", "properties": { "type": { "type": "string", "description": "Signal type identifier", "enum": [ "companyIsHiring", "companyRaisedFunds", "recruitmentCampaign", "jobChange", "newHire", "companyEmployeeVisitedMyWebsite", "customSignals", "competitorConnections", "competitorReactions", "companyFollowers", "technologyChange", "linkedinPeopleProfile", "linkedinCompanyProfile", "mergersAcquisitions", "promotion", "linkedinKeywords", "externalSignalContact", "externalSignalCompany", "buyingIntent" ] }, "title": { "type": "string", "description": "Display title" }, "description": { "type": "string", "description": "What this signal detects" } } }, "WatchListApiListWatchListsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/WatchListSchema" } }, "meta": { "$ref": "#/components/schemas/WatchListListMeta" } } }, "ExternalSignalPushResponse": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "processed", "ignored" ], "description": "`processed` when a signal was created, `ignored` otherwise" }, "signalId": { "type": "string", "description": "Id of the created signal. Present when status is processed.", "example": "wls_ExAmPlE1234567890a" }, "reason": { "type": "string", "enum": [ "no_entity_match", "daily_limit_reached" ], "description": "Why the signal was ignored. Present when status is ignored." }, "creditsConsumed": { "type": "integer", "description": "Always 0 - external signals are free.", "example": 0 }, "entity": { "type": "object", "description": "The matched entity. Present when status is processed.", "properties": { "type": { "type": "string", "enum": [ "contact", "company" ] }, "id": { "type": "string", "description": "Entity id or watch key", "example": "lea_ExAmPlE1234567890a" }, "enriched": { "type": "boolean", "description": "Whether the entity was enriched from lemlist data" } } } } }, "WatchListApiWatchListResponse": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/WatchListSchema" } } }, "WatchListApiDeleteWatchListResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "_id": { "type": "string", "description": "Deleted Signal Agent id" }, "deleted": { "type": "boolean", "description": "Whether a document was removed" }, "deletedCount": { "type": "integer", "description": "Number of documents removed" } } } } }, "WatchListApiHistoryResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/WatchListConfigHistoryEntry" } }, "meta": { "$ref": "#/components/schemas/WatchListListMeta" } } }, "WatchListApiLibraryResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/WatchListLibraryEntry" } } } }, "WatchListApiFiltersResponse": { "type": "object", "properties": { "data": { "type": "object", "description": "Allowed filters keyed by signal type", "additionalProperties": { "type": "array", "items": { "$ref": "#/components/schemas/WatchListFilterDescriptor" } } } } }, "WatchListApiFilterValuesResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "filterId": { "type": "string", "description": "Resolved filter identifier" }, "results": { "type": "array", "nullable": true, "description": "Resolved values, or null when the filter resolves nothing", "items": { "type": "string" } } } } } }, "DeliverabilityAlert": { "type": "object", "description": "A deliverability alert configuration. The alert is evaluated periodically against your warm-up or outreach metrics and triggers notifications through the configured channels (in-app, email, webhook, Slack) when the threshold is breached.", "properties": { "_id": { "type": "string", "description": "Unique alert configuration identifier (prefixed with `dac_`)." }, "teamId": { "type": "string", "description": "ID of the team that owns the alert." }, "createdBy": { "type": "string", "description": "ID of the user who created the alert." }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp." }, "updatedAt": { "type": "string", "format": "date-time", "description": "Last update timestamp." }, "widget": { "type": "string", "description": "Data source the alert evaluates. `warmup` checks lemwarm metrics; `outreach` checks campaign-sending metrics.", "enum": [ "warmup", "outreach" ] }, "metric": { "type": "string", "description": "Metric being monitored. Valid combinations depend on `widget`: `warmup` supports `inboxRate`, `spamRate`, `score`; `outreach` supports `deliveryRate`, `bounceRate`.", "enum": [ "inboxRate", "spamRate", "score", "deliveryRate", "bounceRate" ] }, "severity": { "type": "string", "description": "Alert severity.", "enum": [ "warning", "critical" ] }, "scope": { "type": "string", "description": "Aggregation level the metric is computed at. `global` covers all of the workspace's mailboxes (warm-up only); `mailbox` evaluates each mailbox individually; `domain` groups mailboxes by their sending domain.", "enum": [ "global", "mailbox", "domain" ] }, "scopeEntities": { "type": "array", "description": "Restricts the alert to a subset of entities matching `scope`. When empty, all entities of that scope are checked. For `scope=mailbox`, each entry is a composite string `userId|email|mailboxId`. For `scope=domain`, each entry is a domain (e.g. `acme.com`). Ignored when `scope=global`.", "items": { "type": "string" } }, "threshold": { "type": "number", "description": "Threshold value the metric is compared against (0–100, expressed as a percentage for rate metrics).", "minimum": 0, "maximum": 100 }, "comparisonOperator": { "type": "string", "description": "How `threshold` is compared to the current value. `below` triggers when the value drops under the threshold; `above` triggers when it exceeds it; `equal` triggers on exact match.", "enum": [ "equal", "below", "above" ] }, "periodDays": { "type": "integer", "description": "Length of the evaluation window, in days (1–30).", "minimum": 1, "maximum": 30 }, "periodMode": { "type": "string", "description": "How the metric is computed over `periodDays`. `rolling` averages the metric across the window; `consecutive` requires the condition to hold on every one of the most recent `periodDays`.", "enum": [ "rolling", "consecutive" ] }, "channelConfig": { "type": "object", "description": "Notification channels triggered when the alert fires. At least one channel must be enabled. If omitted on creation, defaults to `inapp` only.", "properties": { "email": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "addresses": { "type": "array", "description": "Required when `email.enabled` is `true`. At least one valid address.", "items": { "type": "string", "format": "email" } } } }, "inapp": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "Show the alert in the lemlist app." } } }, "webhook": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "Send a webhook callback. Requires a webhook subscribed to the `deliverabilityAlertTriggered` event (see [Add Webhook](/api-reference/endpoints/webhooks/add-webhook))." } } }, "slack": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "Send a Slack message. Requires a Slack integration to be connected on the team." } } } } }, "enabled": { "type": "boolean", "description": "Whether the alert is currently active. Disabled alerts are not evaluated." }, "lastCheckedAt": { "type": "string", "format": "date-time", "description": "Last time the alert was evaluated." }, "lastTriggeredAt": { "type": "string", "format": "date-time", "description": "Last time the alert fired." }, "recheckDelayHours": { "type": "integer", "description": "Cool-down between re-evaluations after the alert has triggered, in hours. Defaults to 12." } } } } }, "paths": { "/team": { "get": { "summary": "Get Team", "tags": [ "Team" ], "parameters": [ { "name": "version", "in": "query", "required": false, "description": "Set to `v2` to include the `users` array, listing each team member's `userId`, `name`, `email`, and `role`. This lets you retrieve the team and its members in a single request.", "schema": { "type": "string", "enum": [ "v2" ] } } ], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Team" }, "example": { "_id": "tea_b4rMsi2trBhahaha", "name": "lemlist", "userIds": [ "usr_4YGm9ez7gMdyhahaha", "usr_5GdFEgSLCN4hahaha", "usr_F7iPChEQ3phahaha" ], "createdBy": "usr_4YGm9ez7gMdyhahaha", "createdAt": "2018-02-22T08:52:30.926Z", "hooks": [ { "_id": "hoo_Ib5jfViX9hn3FzNqr", "targetUrl": "https://hooks.zapier.com/hooks/standard/946357/*some-id*/", "createdAt": "2018-06-05T09:07:07.761Z", "zapId": 123456789, "type": "emailsReplied", "campaignId": "cam_TgyErJghahaha", "isFirst": true }, { "_id": "hoo_SDRr2w4JigZDL7OB2", "targetUrl": "https://hooks.zapier.com/hooks/standard/5078320/*some-other-id*/", "createdAt": "2019-06-05T14:38:56.535Z", "zapId": 987654321, "type": "emailsReplied", "campaignId": "cam_J2M3P9Z8whahaha" }, { "_id": "hoo_IYAPP4HnSyU7UTH3E", "targetUrl": "https://hooks.zapier.com/hooks/standard/5078320/*some-id*/", "createdAt": "2019-06-05T15:49:36.624Z", "zapId": 59831776, "type": "emailsReplied", "campaignId": "cam_qBNYaIFXA77eXM1Ey", "isFirst": true }, { "_id": "hoo_UAtwcPAd0tK9U6hKG", "targetUrl": "https://subdomain.pipedream.net", "createdAt": "2022-02-10T16:45:28.216Z", "campaignId": "cam_7BE8IZRaqahU44Wp6" } ], "slackWebhook": { "url": "https://hooks.slack.com/services/REDACTED*some-id*", "failCounter": 1 }, "beta": [ "outreachQueue", "crmSyncApiSalesforce", "voipWhitelist", "lemrich_postLemrichKafka", "computedFieldActiveCampaigns" ], "pictureId": "fil_vRhMy09kT1Rv4Kq4O.png", "invitedUsers": [ { "email": "support@lemlist.com", "role": "member", "invitedBy": "usr_w7XoMXW37hahaha", "invitedAt": "2023-03-04T20:06:29.585Z" }, { "email": "taylor@example.com", "role": "admin", "invitedBy": "usr_Hq4uzGvFP5q6homd", "invitedAt": "2024-09-13T12:39:55.984Z" } ], "agency": "usr_4YGm9ez7gMd2123456", "customDomain": "custom.domain.com", "users": [ { "userId": "usr_4YGm9ez7gMdyhahaha", "name": "John Doe", "email": "john@lemlist.com", "role": "admin" }, { "userId": "usr_5GdFEgSLCN4hahaha", "name": "Jane Doe", "email": "jane@lemlist.com", "role": "member" } ] } } } }, "400": { "description": "Possible errors: No API key provided / Bad team", "content": { "text/plain": { "example": "No API key provided" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "403": { "description": "User linked to this API key is blocked", "content": { "text/plain": { "example": "User linked to this API key is blocked" } } }, "404": { "description": "No user found for this API key", "content": { "text/plain": { "example": "No user found for this API key" } } } } } }, "/team/senders": { "get": { "summary": "Get Team Senders", "tags": [ "Team" ], "parameters": [ { "name": "state", "in": "query", "required": false, "description": "Filter by campaign's state (running, paused, draft, ended, archived, errors)", "example": "running", "schema": { "type": "string", "enum": [ "running", "paused", "draft", "ended", "archived", "errors" ] } } ], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string" }, "campaigns": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string" }, "name": { "type": "string" }, "status": { "type": "string" }, "sendingChannels": { "type": "array", "items": { "type": "string" } } } } } } } }, "example": [ { "userId": "usr_QB6kKK1wv68DujOET", "campaigns": [ { "_id": "cam_tBpHORyt3WhTQoi5A", "name": "Onboarding", "status": "paused", "sendingChannels": [ "email", "manual", "linkedinVisit" ] }, { "_id": "cam_O3BQOaXuyUuyqEHug", "name": "Community Launch", "status": "running", "sendingChannels": [ "email", "manual", "linkedinVisit" ] }, { "_id": "cam_NTJ1rituEQ61jVl6p", "name": "Email Warmup Test", "status": "ended", "sendingChannels": [ "email", "manual", "linkedinVisit" ] }, { "_id": "cam_1kESsVXFMzfrJImNc", "name": "Product Launch Campaign", "status": "draft", "sendingChannels": [ "email", "manual", "linkedinVisit" ] } ] }, { "userId": "usr_v5xz8De4nsLeNWAfv", "campaigns": [ { "_id": "cam_fDwCRnYtL1cfwcA7k", "name": "WhatsApp Outreach", "status": "draft", "sendingChannels": [ "email", "whatsappMessage" ] }, { "_id": "cam_WBCWNrsoMKkCWWLqw", "name": "WhatsApp Test Campaign", "status": "ended", "sendingChannels": [ "email", "whatsappMessage" ] } ] }, { "userId": "usr_rhhX1KT0qgOGCOrgE", "campaigns": [ { "_id": "cam_pCi08vhGoho2oK3YR", "name": "Networking", "status": "running", "sendingChannels": [ "email", "linkedinSend", "linkedinVisit", "linkedinInvite" ] }, { "_id": "cam_zhcBovstiHVaV1abf", "name": "Product Tools Campaign", "status": "paused", "sendingChannels": [ "email", "linkedinSend", "linkedinVisit", "linkedinInvite" ] } ] } ] } } }, "400": { "description": "Bad params (invalid state parameter)", "content": { "text/plain": { "example": "Bad params (invalid state parameter)" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } } } }, "/team/credits": { "get": { "summary": "Get Team Credits", "tags": [ "Team" ], "parameters": [], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Credits" }, "example": { "credits": 100, "details": { "remaining": { "total": 100, "freemium": 0, "subscription": 80, "gifted": 10, "paid": 10 } } } } } }, "400": { "description": "No API key provided", "content": { "text/plain": { "example": "No API key provided" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "403": { "description": "User linked to this API key is blocked", "content": { "text/plain": { "example": "User linked to this API key is blocked" } } }, "404": { "description": "No user found for this API key", "content": { "text/plain": { "example": "No user found for this API key" } } }, "405": { "description": "Method not allowed" } } } }, "/team/crmUsers": { "get": { "summary": "Get Team CRM Users", "tags": [ "Team" ], "parameters": [], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "userId": { "type": "string", "description": "The lemlist ID of the user whose CRM account is integrated with lemlist" }, "crm": { "type": "string", "description": "The CRM integrated with lemlist (e.g., salesforce, hubspot, pipedrive)" } } } }, "example": [ { "userId": "usr_FU6yAd3UdBFel0UDy", "crm": "salesforce" }, { "userId": "usr_FU6yAd3UdBFel0UDy", "crm": "hubspot" }, { "userId": "usr_FU6yAd3UdBFel0UDy", "crm": "pipedrive" } ] } } }, "400": { "description": "Possible errors: Bad team / Endpoint not available", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } } } } }, "/users/{userId}": { "parameters": [ { "name": "userId", "in": "path", "required": true, "description": "The unique identifier of the user", "example": "usr_eSrHPSoL9QVPUOsho", "schema": { "type": "string" } } ], "get": { "summary": "Get User", "tags": [ "Users" ], "parameters": [], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" }, "example": { "_id": "usr_eSrHPSoL9QVPUOsho", "email": "example@lemlist.co", "role": "admin", "linkedIn": { "linkedinUrl": "https://www.linkedin.com/in/john-doe", "status": true, "inviteLimit": 25, "sendLimit": 33, "visitLimit": 36 }, "mailboxes": [ { "_id": "usm_2mkqJNUjnJQiyVBht", "email": "example@gmail.com", "provider": "google", "status": "ERROR", "lemlist": { "emailLimit": 50 }, "lemwarm": { "active": false } }, { "_id": "usm_gqlN3jKWoGo1Je8El", "email": "example@outlook.com", "status": "ERROR", "lemlist": { "emailLimit": 50 }, "lemwarm": { "active": false } } ] } } } }, "400": { "description": "Possible errors: Bad team / Endpoint not available", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } } } } }, "/campaigns": { "get": { "summary": "Get Many Campaigns", "tags": [ "Campaigns" ], "parameters": [ { "name": "offset", "in": "query", "required": false, "description": "Offset from the start. For pagination.", "example": "24", "schema": { "type": "integer" } }, { "name": "limit", "in": "query", "required": false, "description": "Number of campaigns to retrieve. Default: 100. Maximum: 100.", "example": "2", "schema": { "type": "integer" } }, { "name": "version", "in": "query", "required": false, "description": "Set to 'v2' to use the latest version", "example": "v2", "schema": { "type": "string", "default": "v2", "enum": [ "v2" ] } }, { "name": "page", "in": "query", "required": false, "description": "Page number to retrieve", "example": "1", "schema": { "type": "integer" } }, { "name": "sortBy", "in": "query", "required": false, "description": "The field by which to sort. Currently, only 'createdAt' is supported.", "example": "createdAt", "schema": { "type": "string", "enum": [ "createdAt" ] } }, { "name": "sortOrder", "in": "query", "required": false, "description": "The sort direction. Use 'desc' for descending order; any other value (or omission) will sort in ascending order.", "example": "desc", "schema": { "type": "string", "enum": [ "asc", "desc" ] } }, { "name": "status", "in": "query", "required": false, "description": "The campaign status. Can be: running, draft, archived, ended, paused, errors. Note: a campaign can be in multiple statuses at one time (e.g., a paused campaign with errors).", "example": "running", "schema": { "type": "string", "enum": [ "running", "draft", "archived", "ended", "paused", "errors" ] } }, { "name": "createdBy", "in": "query", "required": false, "description": "Filter campaigns by creator user ID (usr_xxx format). Only returns campaigns created by the specified user.", "example": "usr_QG9E94KvTmC7KWqzs", "schema": { "type": "string" } } ], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Campaign" } }, "example": [ { "_id": "cam_4HrZbi8xsez4QlrnL", "name": "Product Launch Campaign", "emoji": "🚀", "timezone": "Europe/Paris", "labels": [], "createdAt": "2025-02-20T14:45:54.230Z", "createdBy": "usr_zdTCrNFyXblc4mrYK", "status": "running", "hasError": true, "errors": [ "Your campaign does not have sender." ] }, { "_id": "cam_k3gu2sa4KIfhRK34M", "name": "Sales Outreach 2025", "labels": [], "createdAt": "2025-02-05T09:00:07.541Z", "createdBy": "usr_UEvrOEP0CTAYEoFR4", "status": "running", "hasError": true, "errors": [ "One of your sender has no email provider.", "Your campaign have an invalid sender mailbox" ] }, { "_id": "cam_HcFmYEhnCI39Pscan", "name": "CRM Integration Test", "labels": [ "CRM" ], "createdAt": "2023-01-27T14:58:52.482Z", "createdBy": "usr_i52PiQtbq8SucjVTM", "status": "running", "hasError": true, "errors": [ "One of your sender has no email provider.", "Your campaign have an invalid sender mailbox" ] }, { "_id": "cam_yZXeC6q3SXs3ha1FI", "name": "Customer Onboarding", "labels": [], "createdAt": "2022-06-14T13:32:57.880Z", "createdBy": "usr_i52PiQtbq8SucjVTM", "status": "running" } ] } } }, "400": { "description": "No API key provided", "content": { "text/plain": { "example": "No API key provided" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "403": { "description": "User linked to this API key is blocked", "content": { "text/plain": { "example": "User linked to this API key is blocked" } } }, "404": { "description": "No user found for this API key", "content": { "text/plain": { "example": "No user found for this API key" } } } } }, "post": { "summary": "Create Campaign", "tags": [ "Campaigns" ], "parameters": [], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "_id": { "type": "string" }, "sequenceId": { "type": "string" }, "scheduleIds": { "type": "array", "items": { "type": "string" } }, "teamId": { "type": "string" }, "createdBy": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "state": { "type": "string" }, "scannedCount": { "type": "integer" }, "reviewedCount": { "type": "integer" }, "inSequenceLeadCount": { "type": "integer" }, "variableKeys": { "type": "array", "items": {} }, "senders": { "type": "array", "items": {} }, "sendUsers": { "type": "array", "items": {} }, "displayedVariableKeys": { "type": "array", "items": { "type": "string" } }, "emoji": { "type": "string" }, "stopOnEmailReplied": { "type": "boolean" }, "crmOpportunitiesOnTask": { "type": "boolean" }, "unsubscribe": { "type": "string" }, "name": { "type": "string" }, "crm": { "type": "string" }, "crmUserId": { "type": "string" } } }, "example": { "_id": "cam_kok3I33Sba7mcNIO7", "sequenceId": "seq_ScVmFnlKdP6aVmyZN", "scheduleIds": [ "skd_IrCdCoQ0ZUAEeUDwR" ], "teamId": "tea_edrkv2LgUK4Wf4ZzO", "createdBy": "usr_Sy3xIhbEi7auHFv5A", "createdAt": "2025-01-16T13:53:22.726Z", "state": "running", "scannedCount": 0, "reviewedCount": 0, "inSequenceLeadCount": 0, "variableKeys": [], "senders": [], "sendUsers": [], "displayedVariableKeys": [ "companyName" ], "emoji": "🚀", "stopOnEmailReplied": true, "crmOpportunitiesOnTask": true, "unsubscribe": "campaign", "name": "My new campaign", "crm": "hubspot", "crmUserId": "usr_0p9Q8ZyXSTNGpsHOe" } } } }, "400": { "description": "No API key provided", "content": { "text/plain": { "example": "No API key provided" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "403": { "description": "User linked to this API key is blocked", "content": { "text/plain": { "example": "User linked to this API key is blocked" } } }, "404": { "description": "No user found for this API key", "content": { "text/plain": { "example": "No user found for this API key" } } } }, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the campaign" }, "timezone": { "type": "string", "description": "IANA timezone for the campaign schedule (e.g. `America/New_York`). Defaults to `Europe/Paris` if omitted." }, "autoReview": { "type": "boolean", "description": "Automatically launch (review) leads as soon as they are added to the campaign, instead of requiring manual review. Defaults to `false`." }, "autoReviewConditions": { "type": "array", "items": { "type": "string", "enum": [ "deliverable", "risky", "undeliverable", "unverified" ] }, "description": "Email deliverability statuses for which a lead is auto-launched when `autoReview` is enabled. Only leads whose email verification matches one of these statuses are launched automatically. Invalid values are rejected with a `400` error." } }, "required": [ "name" ] }, "example": { "name": "My new campaign", "timezone": "America/New_York", "autoReview": true, "autoReviewConditions": [ "deliverable", "risky" ] } } } } } }, "/campaigns/{campaignId}": { "parameters": [ { "name": "campaignId", "in": "path", "required": true, "description": "The unique identifier of the campaign", "example": "cam_A1B2C3D4E5F6G7H8I9", "schema": { "type": "string" } } ], "get": { "summary": "Get Campaign", "tags": [ "Campaigns" ], "parameters": [], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Campaign" }, "example": { "_id": "cam_bSn8EORHQxbWPjHvu", "name": "Product Launch Campaign", "createdAt": "2025-10-27T07:01:04.058Z", "status": "draft", "creator": { "userId": "usr_ahfFktBBHUIxbVG5P", "userEmail": "support@lemlist.com" }, "senders": [ { "id": "usr_rhhX1KT0qgOGCOrgE", "email": "support@lemlist.com", "sendUserMailboxId": "usm_J7BzS86A1vRMc2AuB" } ] } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Campaign not found", "content": { "text/plain": { "example": "Campaign not found" } } } } }, "patch": { "summary": "Update Campaign", "tags": [ "Campaigns" ], "parameters": [], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The campaign name" }, "stopOnEmailReplied": { "type": "boolean", "description": "Stop the campaign when a lead replies by email" }, "stopOnMeetingBooked": { "type": "boolean", "description": "Stop the campaign when a meeting is booked" }, "stopOnLinkClicked": { "type": "boolean", "description": "Stop the campaign when a link is clicked" }, "leadsPausedByInterest": { "type": "boolean", "description": "Pause leads based on interest" }, "opportunityReplied": { "type": "boolean", "description": "Create an opportunity when a lead replies" }, "opportunityClicked": { "type": "boolean", "description": "Create an opportunity when a lead clicks a link" }, "autoLeadInterest": { "type": "boolean", "description": "Automatically detect lead interest" }, "disableTrackOpen": { "type": "boolean", "description": "Disable tracking of email opens" }, "disableTrackClick": { "type": "boolean", "description": "Disable tracking of link clicks" }, "disableTrackReply": { "type": "boolean", "description": "Disable tracking of email replies" }, "disableOutOfOffice": { "type": "boolean", "description": "Disable out-of-office detection" }, "sequenceSharing": { "type": "boolean", "description": "Enable sequence sharing for the campaign" }, "stopOnLinkClickedFilter": { "type": "string", "description": "Filter for which link clicks should stop the campaign" }, "sendUsers": { "type": "array", "description": "Configured senders for the campaign. Only present when sendUserIds was provided in the request. Senders that lack capabilities for any campaign sending channel are excluded.", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "User ID of the sender" }, "mailboxes": { "type": "array", "description": "Connected email mailboxes", "items": { "type": "object", "properties": { "sendUserMailboxId": { "type": "string" }, "email": { "type": "string" } } } }, "phoneNumbers": { "type": "array", "description": "Connected phone numbers", "items": { "type": "string" } }, "whatsappAccountIds": { "type": "array", "description": "Connected WhatsApp account IDs", "items": { "type": "string" } } } } } } }, "example": { "name": "New campaign name", "stopOnEmailReplied": true, "stopOnMeetingBooked": true, "stopOnLinkClicked": false, "leadsPausedByInterest": false, "opportunityReplied": true, "opportunityClicked": false, "autoLeadInterest": true, "disableTrackOpen": false, "disableTrackClick": false, "disableTrackReply": false, "disableOutOfOffice": false, "sequenceSharing": false, "sendUsers": [ { "id": "usr_2aBCdEfGHiJkLmNOp", "mailboxes": [ { "sendUserMailboxId": "smb_1aBcDeFgHiJkLmNoP", "email": "john@acme.com" } ], "phoneNumbers": [ "+15551234567" ], "whatsappAccountIds": [ "wha_3xYzAbCdEfGhIjKlM" ] }, { "id": "usr_7xYzAbCdEfGhIjKlM", "mailboxes": [ { "sendUserMailboxId": "smb_9zYxWvUtSrQpOnMlK", "email": "jane@acme.com" } ], "phoneNumbers": [], "whatsappAccountIds": [] } ] } } } }, "400": { "description": "Bad request", "content": { "text/plain": { "schema": { "type": "string" }, "examples": { "badTeam": { "summary": "Bad team", "value": "Bad team" }, "dynamicStrategy": { "summary": "Cannot update senders for dynamic strategy campaigns", "value": "Cannot update senders on campaigns with a dynamic sender strategy (contactOwner, leadImporter, customField)" }, "noValidSenders": { "summary": "No valid sender IDs", "value": "None of the provided sender IDs are members of this team" }, "noCapableSenders": { "summary": "No senders with required capabilities", "value": "None of the provided senders have the required capabilities for this campaign" }, "missingChannels": { "summary": "Campaign channels not covered", "value": "The provided senders do not cover the following campaign channels: linkedin, sms" } } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Campaign not found", "content": { "text/plain": { "example": "Campaign not found" } } } }, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The campaign name" }, "stopOnEmailReplied": { "type": "boolean", "description": "Stop the campaign when a lead replies by email" }, "stopOnMeetingBooked": { "type": "boolean", "description": "Stop the campaign when a meeting is booked" }, "stopOnLinkClicked": { "type": "boolean", "description": "Stop the campaign when a link is clicked" }, "leadsPausedByInterest": { "type": "boolean", "description": "Pause leads based on interest" }, "opportunityReplied": { "type": "boolean", "description": "Create an opportunity when a lead replies" }, "opportunityClicked": { "type": "boolean", "description": "Create an opportunity when a lead clicks a link" }, "autoLeadInterest": { "type": "boolean", "description": "Automatically detect lead interest" }, "disableTrackOpen": { "type": "boolean", "description": "Disable tracking of email opens" }, "disableTrackClick": { "type": "boolean", "description": "Disable tracking of link clicks" }, "disableTrackReply": { "type": "boolean", "description": "Disable tracking of email replies" }, "disableOutOfOffice": { "type": "boolean", "description": "Disable out-of-office detection" }, "sequenceSharing": { "type": "boolean", "description": "Enable sequence sharing for the campaign" }, "stopOnLinkClickedFilter": { "type": "string", "description": "Filter for which link clicks should stop the campaign" }, "sendUserIds": { "type": "array", "items": { "type": "string" }, "description": "Array of user IDs (usr_xxx format) to assign as campaign senders. Cannot be used on campaigns with a dynamic sender strategy (contactOwner, leadImporter, customField). Each sender is validated against the campaign's sending channels (email, LinkedIn, SMS, WhatsApp): senders without capabilities for at least one channel are excluded, and all channels must be covered by at least one sender." }, "autoReview": { "type": "boolean", "description": "Automatically launch (review) leads as soon as they are added to the campaign, instead of requiring manual review." }, "autoReviewConditions": { "type": "array", "items": { "type": "string", "enum": [ "deliverable", "risky", "undeliverable", "unverified" ] }, "description": "Email deliverability statuses for which a lead is auto-launched when `autoReview` is enabled. Only leads whose email verification matches one of these statuses are launched automatically. Invalid values are rejected with a `400` error." }, "aiFeatures": { "type": "object", "description": "AI reply-handling settings. Provide only the flags to change; omitted flags keep their current value.", "properties": { "scoreReplies": { "type": "boolean", "description": "Enable AI reply scoring for this campaign." }, "onInterestedReply": { "type": "object", "description": "AI action when a reply is detected as INTERESTED.", "properties": { "enabled": { "type": "boolean", "description": "Enable the interested-reply AI action." }, "pauseAllCampaignsForLead": { "type": "boolean", "description": "Pause all campaigns for this lead." }, "pauseCampaignForCompany": { "type": "boolean", "description": "Pause this campaign for other leads in the same company." }, "pauseAllCampaignsForCompany": { "type": "boolean", "description": "Pause all campaigns for leads in the same company." } } }, "onNotInterestedReply": { "type": "object", "description": "AI action when a reply is detected as NOT interested.", "properties": { "enabled": { "type": "boolean", "description": "Enable the not-interested-reply AI action." }, "pauseAllCampaignsForLead": { "type": "boolean", "description": "Pause all campaigns for this lead." }, "pauseCampaignForCompany": { "type": "boolean", "description": "Pause this campaign for other leads in the same company." }, "pauseAllCampaignsForCompany": { "type": "boolean", "description": "Pause all campaigns for leads in the same company." } } } } }, "tracking": { "type": "object", "description": "Open / click / reply tracking toggles.", "properties": { "trackOpens": { "type": "boolean", "description": "Whether email open tracking is enabled." }, "trackClicks": { "type": "boolean", "description": "Whether link click tracking is enabled." }, "trackReplies": { "type": "boolean", "description": "Whether reply tracking is enabled." } } }, "onReplied": { "type": "object", "description": "Behavior when a lead replies.", "properties": { "createNewTask": { "type": "boolean", "description": "Create a task when a lead replies." }, "campaignProgress": { "type": "string", "enum": ["continue", "pause", "stop"], "description": "What happens to the lead on reply." }, "propagateProgressToCompany": { "type": "boolean", "description": "Apply the same action to other leads in the same company." }, "disableOutOfOffice": { "type": "boolean", "description": "Whether out-of-office detection is disabled." } } }, "onLinkClicked": { "type": "object", "description": "Behavior when a lead clicks a tracked link.", "properties": { "createNewTask": { "type": "boolean", "description": "Create a task when a lead clicks a link." }, "campaignProgress": { "type": "string", "enum": ["continue", "pause", "stop"], "description": "What happens to the lead on link click." }, "propagateProgressToCompany": { "type": "boolean", "description": "Apply the same action to other leads in the same company." }, "specificLinks": { "type": "array", "items": { "type": "string" }, "description": "If non-empty, only these link URLs trigger the action (empty = all links)." } } }, "onMeetingBooked": { "type": "object", "description": "Behavior when a meeting is booked.", "properties": { "campaignProgress": { "type": "string", "enum": ["continue", "pause", "stop"], "description": "What happens to the lead when a meeting is booked." }, "propagateProgressToCompany": { "type": "boolean", "description": "Apply the same action to other leads in the same company." } } } } }, "example": { "name": "New campaign name", "stopOnEmailReplied": true, "stopOnMeetingBooked": true, "stopOnLinkClicked": false, "leadsPausedByInterest": false, "opportunityReplied": true, "opportunityClicked": false, "autoLeadInterest": true, "disableTrackOpen": false, "disableTrackClick": false, "disableTrackReply": false, "disableOutOfOffice": false, "sequenceSharing": false, "sendUserIds": [ "usr_2aBCdEfGHiJkLmNOp", "usr_7xYzAbCdEfGhIjKlM" ], "autoReview": true, "autoReviewConditions": [ "deliverable", "risky" ] } } } } } }, "/campaigns/{campaignId}/pause": { "parameters": [ { "name": "campaignId", "in": "path", "required": true, "description": "The unique identifier of the campaign", "example": "cam_A1B2C3D4E5F6G7H8I9", "schema": { "type": "string" } } ], "post": { "summary": "Pause Campaign", "tags": [ "Campaigns" ], "parameters": [], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "_id": { "type": "string" }, "state": { "type": "string" } } }, "example": { "_id": "cam_A1B2C3D4E5F6G7H8I9", "state": "paused" } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Campaign not found", "content": { "text/plain": { "example": "Campaign not found" } } } } } }, "/campaigns/{campaignId}/start": { "parameters": [ { "name": "campaignId", "in": "path", "required": true, "description": "The unique identifier of the campaign", "example": "cam_A1B2C3D4E5F6G7H8I9", "schema": { "type": "string" } } ], "post": { "summary": "Start Campaign", "tags": [ "Campaigns" ], "parameters": [], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "_id": { "type": "string" }, "state": { "type": "string" } } }, "example": { "_id": "cam_A1B2C3D4E5F6G7H8I9", "state": "running" } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Campaign not found", "content": { "text/plain": { "example": "Campaign not found" } } } } } }, "/campaigns/{campaignId}/export/start": { "parameters": [ { "name": "campaignId", "in": "path", "required": true, "description": "The unique identifier of the campaign to export", "example": "cam_A1B2C3D4E5F6G7H8I9", "schema": { "type": "string" } } ], "get": { "summary": "Start Campaign Stats Export", "description": "Start an asynchronous export of all campaign statistics. The final export result is a CSV file.", "tags": [ "Campaigns" ], "parameters": [], "responses": { "200": { "description": "Export started successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "_id": { "type": "string", "description": "The unique identifier of the export" }, "id": { "type": "string", "description": "The unique identifier of the export (same as _id)" }, "teamId": { "type": "string", "description": "The team identifier" }, "campaignId": { "type": "string", "description": "The campaign identifier" }, "campaignName": { "type": "string", "description": "The name of the campaign" }, "status": { "type": "string", "enum": [ "pending", "done", "error" ], "description": "Current status of the export" }, "startedAt": { "type": "string", "format": "date-time", "description": "When the export was started" }, "progressIndex": { "type": "integer", "description": "Current progress index" }, "progressTime": { "type": "integer", "description": "Timestamp of progress" }, "progressLastStepDuration": { "type": "integer", "description": "Duration of last step in milliseconds" }, "progressType": { "type": "string", "description": "Type of current progress step" }, "progress": { "type": "integer", "description": "Number of items processed" }, "total": { "type": "integer", "description": "Total number of items to process" } } }, "example": { "_id": "axp_Vv6lJOc8NlVVmDud5", "id": "axp_Vv6lJOc8NlVVmDud5", "teamId": "tea_c123fg5h8ijKL9noP", "campaignId": "cam_A1B2C3D4E5F6G7H8I9", "campaignName": "Insights Outreach 2024", "status": "pending", "startedAt": "2024-07-09T13:43:52.124Z", "progressIndex": 0, "progressTime": 1720532632124, "progressLastStepDuration": 0, "progressType": "starting", "progress": 0, "total": 0 } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Campaign not found", "content": { "text/plain": { "example": "Campaign not found" } } } } } }, "/campaigns/{campaignId}/export/{exportId}/status": { "parameters": [ { "name": "campaignId", "in": "path", "required": true, "description": "The unique identifier of the campaign that was exported", "example": "cam_A1B2C3D4E5F6G7H8I9", "schema": { "type": "string" } }, { "name": "exportId", "in": "path", "required": true, "description": "The unique identifier of the export returned by the /start endpoint", "example": "axp_Vv6lJOc8NlVVmDud5", "schema": { "type": "string" } } ], "get": { "summary": "Get Campaign Export Status", "description": "Check the status of an asynchronous campaign export.", "tags": [ "Campaigns" ], "parameters": [], "responses": { "200": { "description": "Export status retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "status": { "type": "object", "properties": { "_id": { "type": "string", "description": "MongoDB identifier of the export" }, "id": { "type": "string", "description": "The unique identifier of the export" }, "teamId": { "type": "string", "description": "The team identifier" }, "campaignId": { "type": "string", "description": "The campaign identifier" }, "campaignName": { "type": "string", "description": "The name of the campaign" }, "status": { "type": "string", "enum": [ "pending", "done", "error" ], "description": "Current status of the export" }, "startedAt": { "type": "string", "format": "date-time", "description": "When the export was started" }, "endedAt": { "type": "string", "format": "date-time", "description": "When the export finished (only present when done)" }, "progressIndex": { "type": "integer", "description": "Current progress index" }, "progressTime": { "type": "integer", "description": "Timestamp of progress" }, "progressLastStepDuration": { "type": "integer", "description": "Duration of last step in milliseconds" }, "progressType": { "type": "string", "description": "Type of current progress step" }, "progress": { "type": "integer", "description": "Number of items processed" }, "total": { "type": "integer", "description": "Total number of items to process" }, "fileSize": { "type": "integer", "description": "Size of the exported CSV file in bytes (only present when done)" }, "url": { "type": "string", "description": "Download URL for the CSV file (only present when status is done)" } } } } }, "examples": { "done": { "summary": "Export completed", "value": { "ok": true, "status": { "_id": "axp_eVuZ9rVr4yYWrnPWA", "id": "axp_eVuZ9rVr4yYWrnPWA", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "campaignId": "cam_lBCWmqEWI399hJZOd", "campaignName": "lemstage", "status": "done", "startedAt": "2025-10-27T07:53:16.267Z", "progressIndex": 6, "progressTime": 1761551597286, "progressLastStepDuration": 0, "progressType": "done", "progress": 0, "total": 0, "fileSize": 23654, "endedAt": "2025-10-27T07:53:17.286Z", "url": "https://api.lemlist.com/api/files/exports/fil_axp_7guBefhehehe.csv" } } }, "pending": { "summary": "Export in progress", "value": { "ok": true, "status": { "id": "axp_Vv6lJOc8NlVVmDud5", "teamId": "tea_c123fg5h8ijKL9noP", "campaignId": "cam_A1B2C3D4E5F6G7H8I9", "campaignName": "Insights Outreach 2024", "status": "pending", "startedAt": "2020-01-01T00:00:00.000Z", "progressIndex": 3, "progressTime": 1639138959979, "progressLastStepDuration": 200, "progressType": "processing", "progress": 50, "total": 100 } } } } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Campaign or export not found", "content": { "application/json": { "schema": { "oneOf": [ { "type": "object", "properties": { "ok": { "type": "boolean" }, "message": { "type": "string" } } }, { "type": "string" } ] }, "examples": { "exportNotFound": { "summary": "Export not found", "value": { "ok": false, "message": "Export with id axp_DIoSPp9YM5EwWdyP0 not found" } }, "campaignNotFound": { "summary": "Campaign not found", "value": "Campaign not found" } } } } } } } }, "/campaigns/{campaignId}/export/{exportId}/email/{email}": { "parameters": [ { "name": "campaignId", "in": "path", "required": true, "description": "The unique identifier of the campaign that was exported", "example": "cam_A1B2C3D4E5F6G7H8I9", "schema": { "type": "string" } }, { "name": "exportId", "in": "path", "required": true, "description": "The unique identifier of the export returned by the /start endpoint", "example": "axp_Vv6lJOc8NlVVmDud5", "schema": { "type": "string" } }, { "name": "email", "in": "path", "required": true, "description": "The email address to send the export URL to when the export is done", "example": "emily.johnson@example.com", "schema": { "type": "string", "format": "email" } } ], "put": { "summary": "Set Email for Campaign Export Notification", "description": "Set an email address for a given export. When the export is done, an email with the download URL will be sent to the address provided.", "tags": [ "Campaigns" ], "parameters": [], "responses": { "200": { "description": "Email notification set successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "status": { "type": "object", "properties": { "_id": { "type": "string" }, "id": { "type": "string" }, "teamId": { "type": "string" }, "campaignId": { "type": "string" }, "campaignName": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "done", "error" ] }, "startedAt": { "type": "string", "format": "date-time" }, "progressIndex": { "type": "integer" }, "progressTime": { "type": "integer" }, "progressLastStepDuration": { "type": "integer" }, "progressType": { "type": "string" }, "progress": { "type": "integer" }, "total": { "type": "integer" }, "fileSize": { "type": "integer", "description": "Size of the export file in bytes" }, "endedAt": { "type": "string", "format": "date-time" }, "url": { "type": "string", "description": "Download URL for the CSV file" }, "email": { "type": "string", "format": "email", "description": "Email address that will receive the notification" } } } } }, "example": { "ok": true, "status": { "_id": "axp_Vv6lJOc8NlVVmDud5", "id": "axp_Vv6lJOc8NlVVmDud5", "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_Vv6lJOc8NlVVmDud5_insights_outreach_2024.csv", "email": "emily.johnson@example.com" } } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Campaign or export not found", "content": { "text/plain": { "examples": { "campaignNotFound": { "summary": "Campaign not found", "value": "Campaign not found" }, "exportNotFound": { "summary": "Export not found", "value": "Export not found" } } } } } } } }, "/campaigns/{campaignId}/export/leads": { "parameters": [ { "name": "campaignId", "in": "path", "required": true, "description": "The unique identifier of the campaign", "example": "cam_A1B2C3D4E5F6G7H8I9", "schema": { "type": "string" } } ], "get": { "summary": "Export Campaign Leads", "description": "Export leads from a campaign with filtering options. Returns leads in CSV or JSON format based on their state (e.g., contacted, interested, replied, etc.).", "tags": [ "Campaigns" ], "parameters": [ { "name": "state", "in": "query", "required": false, "description": "Filter to export only the specified lead's last states. Use 'all' to export all states. Can be a comma-separated list of states. **Global states**: imported, scanned, skipped, reviewed, contacted, hooked, attracted, warmed, interested, notInterested, emailsBounced, emailsUnsubscribed, failed, meetingBooked, paused. **Detailed states**: emailsSent, emailsOpened, emailsClicked, emailsReplied, emailsInterested, emailsNotInterested, emailsFailed, opportunitiesDone, aircallDone, aircallInterested, aircallNotInterested, apiDone, apiInterested, apiNotInterested, linkedinVisitDone, linkedinVisitFailed, linkedinInviteDone, linkedinInviteAccepted, linkedinInviteFailed, linkedinSent, linkedinOpened, linkedinReplied, linkedinInterested, linkedinNotInterested, linkedinSendFailed, manualInterested, manualNotInterested", "example": "all", "schema": { "type": "string", "enum": [ "all", "imported", "scanned", "skipped", "reviewed", "contacted", "hooked", "attracted", "warmed", "interested", "notInterested", "emailsBounced", "emailsUnsubscribed", "failed", "meetingBooked", "paused", "emailsSent", "emailsOpened", "emailsClicked", "emailsReplied", "emailsInterested", "emailsNotInterested", "emailsFailed", "opportunitiesDone", "aircallDone", "aircallInterested", "aircallNotInterested", "apiDone", "apiInterested", "apiNotInterested", "linkedinVisitDone", "linkedinVisitFailed", "linkedinInviteDone", "linkedinInviteAccepted", "linkedinInviteFailed", "linkedinSent", "linkedinOpened", "linkedinReplied", "linkedinInterested", "linkedinNotInterested", "linkedinSendFailed", "manualInterested", "manualNotInterested" ], "default": "all" } }, { "name": "format", "in": "query", "required": false, "description": "Output format: 'json' or 'csv'. Default is CSV.", "example": "json", "schema": { "type": "string", "enum": [ "json", "csv" ] } } ], "responses": { "200": { "description": "Leads exported successfully", "content": { "text/csv": { "example": "emailStatus,email,firstName,lastName,picture,phone,linkedinUrl,timezone,companyName,companyDomain,icebreaker,Original event page,url extension,event_link_to_send,testFieldToDelete,naissance,lastState,status,_id\n,jeremy@example.com,Jeremy,Smith,,,https://www.linkedin.com/in/jeremysmith,,example.com,,,https://www.example.com/event-registration,?name=Jeremy&email=jeremy@example.com,https://www.example.com/event-registration?name=Jeremy&email=jeremy@example.com,,,linkedinReplied,done,lea_s2cXajAHahdDKmDw8\n,frankie@example.org,Frankie,Johnson,,,https://www.linkedin.com/in/frankiejohnson,,example.org,,,https://www.example.com/event-registration,?name=Frankie&email=frankie@example.org,https://www.example.com/event-registration?name=Frankie&email=frankie@example.org,,,linkedinReplied,done,lea_E8hdds5NryDRXpGJa\n,louiza@example.io,Louiza,Brown,,,https://www.linkedin.com/in/louizabrown,,example.io,,,https://www.example.com/event-registration,?name=Louiza&email=louiza@example.io,https://www.example.com/event-registration?name=Louiza&email=louiza@example.io,,,emailsInterested,interested,lea_tLAI7Fr2gR5hVxAIc\n,benjamin@example.co,Benjamin,Williams,,,https://www.linkedin.com/in/benjaminwilliams,,example.co,,,https://www.example.com/event-registration,?name=Benjamin&email=benjamin@example.co,https://www.example.com/event-registration?name=Benjamin&email=benjamin@example.co,,,emailsUnsubscribed,unsubscribed,lea_oznzWQKKZGXrBdqXb\n,roxanne@example.net,Roxanne,Davis,,,https://www.linkedin.com/in/roxannedavis,,example.net,,,https://www.example.com/event-registration,?name=Roxanne&email=roxanne@example.net,https://www.example.com/event-registration?name=Roxanne&email=roxanne@example.net,,,emailsClicked,done,lea_M22nl3gUwvAiNl6Ks\n,thomas@example.fr,Thomas,Miller,,,https://www.linkedin.com/in/thomasmiller,,example.fr,,,https://www.example.com/event-registration,?name=Thomas&email=thomas@example.fr,https://www.example.com/event-registration?name=Thomas&email=thomas@example.fr,,,emailsSent,done,lea_z3DydraGgNBnLdV7o" }, "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "emailStatus": { "type": "string", "enum": [ "deliverable", "risky", "undeliverable" ] }, "email": { "type": "string", "format": "email" }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "picture": { "type": "string" }, "phone": { "type": "string" }, "linkedinUrl": { "type": "string" }, "timezone": { "type": "string" }, "companyName": { "type": "string" }, "companyDomain": { "type": "string" }, "icebreaker": { "type": "string" }, "jobTitle": { "type": "string" }, "lastState": { "type": "string" }, "status": { "type": "string" }, "_id": { "type": "string" } } } } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Campaign not found", "content": { "text/plain": { "example": "Campaign not found" } } } } } }, "/campaigns/reports": { "get": { "summary": "Get Campaign Reports", "description": "Retrieve reports for one or multiple campaigns. Returns aggregated statistics and export status for the specified campaigns.", "tags": [ "Campaigns" ], "parameters": [ { "name": "campaignIds", "in": "query", "required": true, "description": "Comma-separated list of campaign IDs to retrieve reports for", "example": "cam_A1B2C3D4E5F6G7H8I9,cam_B2C3D4E5F6G7H8I9J0", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Campaign reports retrieved successfully", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "description": "Campaign ID" }, "name": { "type": "string", "description": "Campaign name" }, "creator": { "type": "string", "description": "Creator user ID and email in format 'userId|email'" }, "createdAt": { "type": "string", "format": "date-time", "description": "Campaign creation date" }, "createdBy": { "type": "string", "description": "Name of the user who created the campaign" }, "labels": { "type": "string", "description": "Campaign labels" }, "totalCount": { "type": "integer", "description": "Total number of leads" }, "reviewedCount": { "type": "integer", "description": "Number of reviewed leads" }, "inSequenceLeadCount": { "type": "integer", "description": "Number of leads in sequence" }, "state": { "type": "string", "description": "Campaign state (running, paused, etc.)" }, "status": { "type": "string", "description": "Campaign status (draft, ended, etc.)" }, "senderNames": { "type": "string", "description": "Comma-separated list of sender email addresses" }, "sendersUsers": { "type": "string", "description": "Comma-separated list of sender names and emails" }, "reviewed": { "type": "integer", "description": "Number of reviewed leads" }, "emailsSent": { "type": "integer", "description": "Number of emails sent" }, "emailsOpened": { "type": "integer", "description": "Number of emails opened" }, "emailsClicked": { "type": "integer", "description": "Number of emails with links clicked" }, "emailsReplied": { "type": "integer", "description": "Number of email replies received" }, "emailsUnsubscribed": { "type": "integer", "description": "Number of unsubscribes via email" }, "emailsInterested": { "type": "integer", "description": "Number of interested responses via email" }, "linkedinSent": { "type": "integer", "description": "Number of LinkedIn messages sent" }, "linkedinOpened": { "type": "integer", "description": "Number of LinkedIn messages opened" }, "linkedinReplied": { "type": "integer", "description": "Number of LinkedIn replies received" }, "interested": { "type": "integer", "description": "Total number of interested leads" }, "notInterested": { "type": "integer", "description": "Total number of not interested leads" } } } }, "example": [ { "_id": "cam_bSn8EORHQxbWPjHvu", "name": "Product Launch Campaign", "creator": "usr_ahfFktBBHUIxbVG5P|user@example.com", "createdAt": "2025-10-27T07:01:04.058Z", "createdBy": "John Smith", "labels": "", "totalCount": 0, "reviewedCount": 0, "inSequenceLeadCount": 0, "state": "running", "status": "draft", "senderNames": "sender@example.com", "sendersUsers": "Jane Doe:sender@example.com", "reviewed": 0, "emailsSent": 0, "emailsOpened": 0, "emailsClicked": 0, "emailsReplied": 0, "emailsInterested": 0, "linkedinSent": 0, "linkedinReplied": 0, "interested": 0, "notInterested": 0 }, { "_id": "cam_lBCWmqEWI399hJZOd", "name": "Event Outreach Campaign", "creator": "usr_QHeXD2DttUIlvWT9V|admin@example.co", "createdAt": "2022-11-09T16:41:03.538Z", "createdBy": "Sarah Johnson", "labels": "", "totalCount": 0, "reviewedCount": 32, "inSequenceLeadCount": 32, "state": "paused", "status": "ended", "senderNames": "", "sendersUsers": "", "reviewed": 0, "emailsSent": 20, "emailsOpened": 18, "emailsClicked": 4, "emailsReplied": 1, "emailsUnsubscribed": 1, "emailsInterested": 1, "linkedinSent": 32, "linkedinOpened": 15, "linkedinReplied": 15, "interested": 0, "notInterested": 0 } ] } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "Unauthorized" } } } }, "/campaigns/{campaignId}/sequences": { "parameters": [ { "name": "campaignId", "in": "path", "required": true, "description": "The unique identifier of the campaign", "example": "cam_A1B2C3D4E5F6G7H8I9", "schema": { "type": "string" } } ], "get": { "summary": "Get Campaign Sequences", "tags": [ "Sequences" ], "parameters": [], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "type": "object", "description": "Object where each key is a sequence ID and each value is a sequence object", "additionalProperties": { "type": "object", "properties": { "_id": { "type": "string", "description": "The unique identifier of the sequence" }, "steps": { "type": "array", "description": "Array of steps in the sequence", "items": { "type": "object", "properties": { "_id": { "type": "string", "description": "The unique identifier of the step" }, "delay": { "type": "integer", "description": "The delay in days before executing this step" }, "emailTemplateId": { "type": "string", "description": "The unique identifier of the email template used for this step" }, "type": { "type": "string", "description": "The type of step (e.g., email, linkedinSend, linkedinInvite, conditional)" }, "index": { "type": "integer", "description": "The position of the step in the sequence" }, "sequenceId": { "type": "string", "description": "The unique identifier of the parent sequence" }, "sequenceStep": { "type": "integer", "description": "The step number in the sequence" }, "message": { "type": "string", "description": "The message content for the step (plain text for LinkedIn, HTML for email)" }, "subject": { "type": "string", "description": "The email subject line (only for email steps)" } } } }, "level": { "type": "integer", "description": "The nesting level of the sequence (0 for main sequence, 1+ for nested conditional sequences)" }, "parentId": { "type": "string", "description": "The unique identifier of the parent sequence (only for conditional sequences)" }, "conditionalStepIndex": { "type": "integer", "description": "The index of the conditional step that triggers this sequence (only for conditional sequences)" } } } }, "example": { "seq_rH5RD3fMkkt2gM3YC": { "_id": "seq_rH5RD3fMkkt2gM3YC", "steps": [ { "_id": "stp_sFUj6keaSz9wr049M", "delay": 0, "emailTemplateId": "etp_ahlbc2yafFyu728H8", "type": "linkedinSend", "index": 1, "sequenceId": "seq_rH5RD3fMkkt2gM3YC", "sequenceStep": 0, "message": "Hey {{firstName}}, \n\nwe're launching an event, a place where people can regularly meet, network, and learn from each other. We would love it if you could join us for a drink & chat next week. What do you say? 😊" }, { "_id": "stp_qsTl0LO6zkQQJQqsP", "delay": 1, "emailTemplateId": "etp_HFjUGtyDxIOxgZYcG", "index": 2, "sequenceId": "seq_rH5RD3fMkkt2gM3YC", "sequenceStep": 1, "subject": "{{firstName}}, do we count on you for the event?", "message": "
Hey {{firstName}},
Do you have any plans for Thursday, 7pm?
What about spending the evening with cool people by our office?
We're launching an event, a place where people can regularly meet, network, and build connections that help them grow further 😊
It would be really nice if we could count on you for the event- here's your invite 🔥
Can you make it?
Sarah,
Head of Marketing
", "type": "email" }, { "_id": "stp_pRcXzJDmOrBkFtNc3", "delay": 1, "emailTemplateId": "etp_3tjFTgdOMS6JL8U1g", "index": 3, "sequenceId": "seq_rH5RD3fMkkt2gM3YC", "sequenceStep": 2, "subject": "{{firstName}}, do we count on you for the event?", "message": "So, should I add you to the list of attendees?
We'll meet around 7pm, have a drink and exchange with entrepreneurs, marketers, and salespeople.
Here's the link if you want to join!
We would love to have you with us for this event!
Sarah
Head of Marketing
", "type": "email" } ], "level": 0 } } } } }, "400": { "description": "Possible errors: Bad team / Campaign has no sequence", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Campaign not found", "content": { "text/plain": { "example": "Campaign not found" } } }, "405": { "description": "Method not allowed" } } } }, "/sequences/{sequenceId}/steps": { "parameters": [ { "name": "sequenceId", "in": "path", "required": true, "description": "The unique identifier of the sequence", "example": "seq_lkCSKd32qSZZTe5Ru", "schema": { "type": "string" } } ], "post": { "summary": "Add Step to Sequence", "tags": [ "Sequences" ], "parameters": [], "responses": { "200": { "headers": { "Content-Type": { "schema": { "type": "string" }, "example": "application/json" } }, "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "_id": { "type": "string" }, "type": { "type": "string" }, "delay": { "type": "integer" }, "emailTemplateId": { "type": "string" }, "message": { "type": "string" } } }, "example": { "_id": "stp_V0JHmSpWiO0rxHUkz", "type": "linkedinInvite", "delay": 2, "emailTemplateId": "etp_sw6csWaZNwnfdwGZ6", "message": "Hello, I would like..." } } } }, "400": { "description": "Possible errors: Bad team / Error from createStep", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } }, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "description": "The type of step to create", "enum": [ "email", "manual", "phone", "api", "linkedinVisit", "linkedinInvite", "linkedinSend", "linkedinVoiceNote", "linkedinFollow", "linkedinLikeLastPost", "linkedinCommentLastPost", "linkedinEndorse", "linkedinWithdrawInvitation", "sendToAnotherCampaign", "conditional", "whatsappMessage", "sms" ] }, "index": { "type": "integer", "description": "The position within the sequence to insert the new step (≥ -1). If omitted or greater than the number of steps, the new step is added to the end" }, "delay": { "type": "integer", "description": "Delay in days before executing this step. Defaults to 0 for the first step and 1 for subsequent steps" }, "subject": { "type": "string", "description": "Email subject line (required for email steps)" }, "message": { "type": "string", "description": "Content of the email or message (used for email, linkedinInvite, linkedinSend, manual, phone, whatsappMessage, sms steps). Required for linkedinSend, whatsappMessage, and sms" }, "altMessage": { "type": "string", "description": "Alternate message for linkedinSend steps" }, "title": { "type": "string", "description": "Title or label for manual steps" }, "method": { "type": "string", "description": "HTTP method for API steps", "enum": [ "GET", "POST", "PUT", "DELETE", "PATCH" ] }, "url": { "type": "string", "description": "URL of the API endpoint to call (required for api steps). Must start with http:// or https://" }, "conditionKey": { "type": "string", "description": "Condition key for conditional steps", "enum": [ "hasEmailAddress", "hasLinkedinUrl", "hasPhoneNumber", "hasScore", "emailsOpened", "emailsClicked", "emailsUnsubscribed", "meetingBooked", "linkedinInviteAccepted", "linkedinOpened", "aircallDone", "linkedinNetworkCheck", "hasWhatsappAccount" ] }, "delayType": { "type": "string", "description": "Delay type for conditional steps", "enum": [ "within", "waitUntil" ] }, "campaignId": { "type": "string", "description": "Target campaign ID for sendToAnotherCampaign steps. The campaign must exist and not be archived" }, "images": { "type": "array", "items": { "type": "string", "format": "uri" }, "description": "Public HTTPS URLs of images to attach to a `linkedinInvite` or `linkedinSend` step. lemlist downloads each file and re-hosts it. 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": { "type": "array", "items": { "type": "string", "format": "uri" }, "description": "Public HTTPS URLs of videos to attach to a `linkedinInvite` or `linkedinSend` step. lemlist downloads each file and re-hosts it. Allowed MIME types: `video/mp4`, `video/quicktime`. Up to 20 MB per file, and up to 6 items total combined with `images`." }, "skillName": { "type": "string", "description": "Name of the LinkedIn skill to endorse on the lead's profile. Applies to `linkedinEndorse` steps only." }, "endorseAnyFallback": { "type": "boolean", "description": "Applies to `linkedinEndorse` steps only. When `true` and the named skill is not on the lead's profile, lemlist falls back to endorsing any available skill." }, "recordMode": { "type": "string", "description": "Applies to `linkedinVoiceNote` steps only. Determines how the audio is sourced. `manual` (default) means the user records the audio themselves from the lemlist UI after step creation; `ai` means lemlist generates the audio from a text template provided in the lemlist UI.", "enum": [ "manual", "ai" ] } } }, "examples": { "Email Step": { "value": { "type": "email", "subject": "{{firstName}}, quick question about {{companyName}}", "message": "Hi {{firstName}},
I noticed {{companyName}} is working on improving customer engagement. Would you be interested in discussing how we can help?
Best regards,
{{senderName}}
Hi {{firstName}},
Just wanted to circle back on our previous email. Have you had a chance to review it?
Best,
{{senderName}}
\n\n\n\nHey Alex ,
I hope this email finds you well!
Have you ever heard about Jordan Doe?
🇫🇷 He was a member of the French Parliament during the French Revolution,
🏘️ He has a street named after him
📙 He authored the famous "Beurre frais épuré, et conservant longtemps ses bonnes qualités, sans devenir rance".
Unfortunately, this brilliant man died ages ago...
But wait, there's another Jordan Doe you might be interested in meeting—one who is very much alive and well! Yes, that's me. I've just joined Lemlist, and I'm looking forward to meeting everyone for a quick chat.
☑️ Book an appointment on 📅 my lemcal !
Feel free to reach out and get to know me better. I'm excited to be part of the team and eager to contribute to our collective success.
Looking forward to seeing you all soon!
Best regards, as your contemporary, Jordan Doe\n\n\n \n\n
Hey Alex ,
I hope this email finds you well!
Have you ever heard about Jordan Doe?
🇫🇷 He was a member of the French Parliament during the French Revolution,
🏘️ He has a street named after him
📙 He authored the famous \"Beurre frais épuré, et conservant longtemps ses bonnes qualités, sans devenir rance\".
Unfortunately, this brilliant man died ages ago...
But wait, there's another Jordan Doe you might be interested in meeting—one who is very much alive and well! Yes, that's me. I've just joined Lemlist, and I'm looking forward to meeting everyone for a quick chat.
☑️ Book an appointment on 📅 my lemcal !
Feel free to reach out and get to know me better. I'm excited to be part of the team and eager to contribute to our collective success.
Looking forward to seeing you all soon!
Best regards, as your contemporary, Jordan Doe
Hello,
Following up on our conversation...
", "cc": [], "replyToActivityId": "latest" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean", "description": "True when the email was sent." }, "contactId": { "type": "string", "description": "The contact the email was sent to (resolved from leadId when only a lead was provided)." } }, "additionalProperties": true }, "example": { "ok": true, "contactId": "ctc_JgrwGbHKgFoEnunBA" } } } }, "400": { "description": "Possible errors: Bad team / Invalid sendUserId / Invalid sendUserEmail / Invalid sendUserMailboxId / contactId or leadId is required / Invalid leadId / Lead not found / Failed to send email", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } }, "parameters": [] } }, "/inbox/linkedin": { "post": { "summary": "Send LinkedIn Message", "tags": [ "Inbox" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "sendUserId": { "type": "string", "description": "Sender user ID" }, "leadId": { "type": "string", "description": "Lead ID" }, "contactId": { "type": "string", "description": "Contact ID" }, "message": { "type": "string", "description": "Message content" } }, "required": [ "sendUserId", "leadId", "contactId", "message" ] }, "example": { "sendUserId": "usr_FU6yAd3UdBFel0UDy", "leadId": "lea_wadZOcDDSFWSbFaCf", "contactId": "ctc_ei6zVayP9B2ugwUPN", "message": "Hi, I wanted to follow up..." } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } } }, "example": { "ok": true } } } }, "400": { "description": "Possible errors: Bad team / Invalid sendUserId / contactId or leadId is required / Invalid leadId / Lead not found / Invalid contactId / Failed to send message", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } }, "parameters": [] } }, "/inbox/whatsapp": { "post": { "summary": "Send WhatsApp Message", "tags": [ "Inbox" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "sendUserId": { "type": "string", "description": "Sender user ID" }, "sendUserWhatsappAccountId": { "type": "string", "description": "WhatsApp account ID" }, "contactId": { "type": "string", "description": "Contact ID" }, "leadId": { "type": "string", "description": "Lead ID" }, "message": { "type": "string", "description": "Message content" } }, "required": [ "sendUserId", "sendUserWhatsappAccountId", "contactId", "leadId", "message" ] }, "example": { "sendUserId": "usr_FU6yAd3UdBFel0UDy", "sendUserWhatsappAccountId": "wha_ABC123", "contactId": "ctc_ei6zVayP9B2ugwUPN", "leadId": "lea_wadZOcDDSFWSbFaCf", "message": "Hi, following up on our conversation" } } } }, "responses": { "200": { "description": "Success" }, "400": { "description": "Possible errors: Bad team / Invalid sendUserId / Invalid sendUserWhatsappAccountId / contactId or leadId is required / Invalid leadId / Lead not found / Failed to send whatsapp message", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } }, "parameters": [] } }, "/inbox/labels": { "get": { "summary": "Get Many Labels", "description": "List all labels available to your team.", "tags": [ "Inbox" ], "responses": { "200": { "description": "Success - Returns array of labels", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Label" } }, "example": [ { "_id": "lbl_uPAAgsi4oi9juBHfW", "name": "Interested", "color": "#F9A2A2", "createdAt": "2025-11-26T15:49:23.470Z", "createdBy": "john.doe@example.com" } ] } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } } }, "parameters": [] }, "post": { "summary": "Create Label", "description": "Creates a new label available to the team.", "tags": [ "Inbox" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "labelName": { "type": "string", "description": "Name of the label to create" } }, "required": [ "labelName" ] }, "example": { "labelName": "Interested" } } } }, "responses": { "200": { "description": "Success - Label created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Label" }, "example": { "_id": "lbl_uPAAgsi4oi9juBHfW", "name": "Interested", "color": "#F9A2A2", "createdAt": "2025-11-26T15:49:23.470Z" } } } }, "400": { "description": "Possible errors: Bad team / labelName is required / Failed to create label", "content": { "text/plain": { "example": "labelName is required" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "409": { "description": "Label with this name already exists", "content": { "text/plain": { "example": "Label with this name already exists" } } }, "405": { "description": "Method not allowed" } }, "parameters": [] } }, "/inbox/labels/{labelId}": { "get": { "summary": "Get Label", "description": "Get info of a specific label.", "tags": [ "Inbox" ], "parameters": [ { "name": "labelId", "in": "path", "required": true, "description": "Label ID", "example": "lbl_uPAAgsi4oi9juBHfW", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Label" }, "example": { "_id": "lbl_uPAAgsi4oi9juBHfW", "name": "Interested", "color": "#F9A2A2", "createdAt": "2025-11-26T15:49:23.470Z", "createdBy": "john.doe@example.com" } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Label not found", "content": { "text/plain": { "example": "Label not found" } } }, "405": { "description": "Method not allowed" } } } }, "/inbox/conversations/labels/{contactId}": { "post": { "summary": "Attach Labels to Conversations", "description": "Attaches one or more labels to one or more conversations.", "tags": [ "Inbox" ], "parameters": [ { "name": "contactId", "in": "path", "required": true, "description": "Contact ID", "example": "ctc_ei6zVayP9B2ugwUPN", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "labelIds": { "type": "array", "description": "Array of label IDs to attach", "items": { "type": "string" } }, "appendLabels": { "type": "boolean", "description": "If true, appends labels to existing ones. If false, replaces all labels." } }, "required": [ "labelIds", "appendLabels" ] }, "example": { "labelIds": [ "lbl_uPAAgsi4oi9juBHfW", "lbl_oZCShmPCP2L43b8qf" ], "appendLabels": true } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } } }, "example": { "ok": true } } } }, "400": { "description": "Possible errors: Bad team / Invalid request body: labelIds must be an array and appendLabels must be a boolean", "content": { "text/plain": { "example": "Invalid request body: labelIds must be an array and appendLabels must be a boolean" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Possible errors: Inbox not found / Label not found", "content": { "text/plain": { "example": "Label not found" } } }, "405": { "description": "Method not allowed" } } }, "delete": { "summary": "Remove Labels from Conversation", "description": "Removes one or more labels from one conversation.", "tags": [ "Inbox" ], "parameters": [ { "name": "contactId", "in": "path", "required": true, "description": "Contact ID", "example": "ctc_ei6zVayP9B2ugwUPN", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "labelIds": { "type": "array", "description": "Array of label IDs to remove", "items": { "type": "string" } } }, "required": [ "labelIds" ] }, "example": { "labelIds": [ "lbl_uPAAgsi4oi9juBHfW" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } } }, "example": { "ok": true } } } }, "400": { "description": "Possible errors: Bad team / Invalid request body: labelIds must be an array", "content": { "text/plain": { "example": "Invalid request body: labelIds must be an array" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Possible errors: Inbox not found / Label not found", "content": { "text/plain": { "example": "Label not found" } } }, "405": { "description": "Method not allowed" } } } }, "/inbox/{contactId}/drafts": { "get": { "summary": "List Drafts", "description": "Lists all non-deleted drafts for a specific contact.", "tags": [ "Inbox" ], "parameters": [ { "name": "contactId", "in": "path", "required": true, "description": "Contact ID", "example": "ctc_ei6zVayP9B2ugwUPN", "schema": { "type": "string" } }, { "name": "draftOwner", "in": "query", "required": true, "description": "Draft owner identifier. Accepts either a userId (e.g., `usr_abc123def456789`) or a login email (e.g., `john@acme.com`).", "example": "usr_abc123def456789", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "drafts": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "description": "Unique draft identifier" }, "channel": { "type": "string", "enum": [ "email", "linkedin", "whatsapp", "sms" ], "description": "Communication channel" }, "subject": { "type": "string", "description": "Draft subject" }, "contentPreview": { "type": "string", "description": "Content preview (max 100 chars)" }, "source": { "type": "string", "enum": [ "api", "ui" ], "description": "Draft creation source" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation date" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Last update date" } } } } } }, "example": { "drafts": [ { "_id": "drf_abc123def456789", "channel": "email", "subject": "Follow up on our meeting", "contentPreview": "Hi John, I wanted to follow up on our conversation from last week...", "source": "api", "createdAt": "2025-01-15T10:30:00.000Z", "updatedAt": "2025-01-15T10:30:00.000Z" } ] } } } }, "400": { "description": "Possible errors: Missing draftOwner / User not found", "content": { "text/plain": { "example": "User not found: neither a valid email nor a valid user id for this team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } } }, "post": { "summary": "Create Draft", "description": "Creates a new draft for a specific contact. The source is automatically set to \"api\".", "tags": [ "Inbox" ], "parameters": [ { "name": "contactId", "in": "path", "required": true, "description": "Contact ID", "example": "ctc_ei6zVayP9B2ugwUPN", "schema": { "type": "string" } }, { "name": "draftOwner", "in": "query", "required": true, "description": "Draft owner identifier. Accepts either a userId (e.g., `usr_abc123def456789`) or a login email (e.g., `john@acme.com`).", "example": "usr_abc123def456789", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "channel": { "type": "string", "enum": [ "email", "linkedin", "whatsapp", "sms" ], "description": "Communication channel" }, "content": { "type": "string", "description": "Draft content (max 30KB)" }, "subject": { "type": "string", "description": "Draft subject (optional)" }, "cc": { "type": "array", "items": { "type": "string" }, "description": "CC email addresses (optional)" }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Attachment file name" }, "url": { "type": "string", "description": "Attachment URL" }, "size": { "type": "integer", "description": "File size in bytes" }, "type": { "type": "string", "description": "MIME type" } } }, "description": "File attachments (optional)" }, "replyToActivityId": { "type": "string", "description": "Activity ID to reply to (optional)" }, "sourceMetadata": { "type": "object", "description": "Additional metadata (optional)" } }, "required": [ "channel", "content" ] }, "example": { "channel": "email", "content": "Hello John, I wanted to follow up on our conversation.
", "subject": "Follow up on our meeting", "cc": [], "attachments": [] } } } }, "responses": { "201": { "description": "Draft created successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "draftId": { "type": "string", "description": "ID of the created draft" } } }, "example": { "draftId": "drf_abc123def456789" } } } }, "400": { "description": "Possible errors: Missing draftOwner / Invalid channel / Content must not be empty / Content too large / Draft limit reached (max 10 per conversation) / User not found", "content": { "text/plain": { "example": "Content must not be empty" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } } } }, "/inbox/{contactId}/drafts/{draftId}": { "get": { "summary": "Get Draft", "description": "Retrieves a single draft with its full content, including attachments.", "tags": [ "Inbox" ], "parameters": [ { "name": "contactId", "in": "path", "required": true, "description": "Contact ID", "example": "ctc_ei6zVayP9B2ugwUPN", "schema": { "type": "string" } }, { "name": "draftId", "in": "path", "required": true, "description": "Draft ID", "example": "drf_abc123def456789", "schema": { "type": "string" } }, { "name": "draftOwner", "in": "query", "required": true, "description": "Draft owner identifier. Accepts either a userId (e.g., `usr_abc123def456789`) or a login email (e.g., `john@acme.com`).", "example": "usr_abc123def456789", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "draft": { "type": "object", "properties": { "_id": { "type": "string", "description": "Unique draft identifier" }, "channel": { "type": "string", "enum": [ "email", "linkedin", "whatsapp", "sms" ], "description": "Communication channel" }, "subject": { "type": "string", "description": "Draft subject" }, "cc": { "type": "array", "items": { "type": "string" }, "description": "CC email addresses" }, "content": { "type": "string", "description": "Full draft content" }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "size": { "type": "integer" }, "type": { "type": "string" } } }, "description": "File attachments" }, "source": { "type": "string", "enum": [ "api", "ui" ], "description": "Draft creation source" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation date" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Last update date" } } } } }, "example": { "draft": { "_id": "drf_abc123def456789", "channel": "email", "subject": "Follow up on our meeting", "cc": [], "content": "Hello John, I wanted to follow up on our conversation.
", "attachments": [], "source": "api", "createdAt": "2025-01-15T10:30:00.000Z", "updatedAt": "2025-01-15T10:30:00.000Z" } } } } }, "400": { "description": "Possible errors: Missing draftOwner / User not found", "content": { "text/plain": { "example": "User not found: neither a valid email nor a valid user id for this team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Draft not found", "content": { "text/plain": { "example": "Draft not found" } } }, "405": { "description": "Method not allowed" } } }, "patch": { "summary": "Update Draft", "description": "Partially updates an existing draft. Only the provided fields will be updated.", "tags": [ "Inbox" ], "parameters": [ { "name": "contactId", "in": "path", "required": true, "description": "Contact ID", "example": "ctc_ei6zVayP9B2ugwUPN", "schema": { "type": "string" } }, { "name": "draftId", "in": "path", "required": true, "description": "Draft ID", "example": "drf_abc123def456789", "schema": { "type": "string" } }, { "name": "draftOwner", "in": "query", "required": true, "description": "Draft owner identifier. Accepts either a userId (e.g., `usr_abc123def456789`) or a login email (e.g., `john@acme.com`).", "example": "usr_abc123def456789", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "subject": { "type": "string", "description": "Draft subject" }, "cc": { "type": "array", "items": { "type": "string" }, "description": "CC email addresses" }, "content": { "type": "string", "description": "Draft content (max 30KB)" }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Attachment file name" }, "url": { "type": "string", "description": "Attachment URL" }, "size": { "type": "integer", "description": "File size in bytes" }, "type": { "type": "string", "description": "MIME type" } } }, "description": "File attachments" }, "replyToActivityId": { "type": "string", "description": "Activity ID to reply to" } } }, "example": { "subject": "Updated subject", "content": "Updated content for the draft.
" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "draft": { "type": "object", "properties": { "_id": { "type": "string", "description": "Unique draft identifier" }, "channel": { "type": "string", "enum": [ "email", "linkedin", "whatsapp", "sms" ], "description": "Communication channel" }, "subject": { "type": "string", "description": "Draft subject" }, "cc": { "type": "array", "items": { "type": "string" }, "description": "CC email addresses" }, "content": { "type": "string", "description": "Full draft content" }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "size": { "type": "integer" }, "type": { "type": "string" } } }, "description": "File attachments" }, "source": { "type": "string", "enum": [ "api", "ui" ], "description": "Draft creation source" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation date" }, "updatedAt": { "type": "string", "format": "date-time", "description": "Last update date" } } } } }, "example": { "draft": { "_id": "drf_abc123def456789", "channel": "email", "subject": "Updated subject", "cc": [], "content": "Updated content for the draft.
", "attachments": [], "source": "api", "createdAt": "2025-01-15T10:30:00.000Z", "updatedAt": "2025-01-15T11:00:00.000Z" } } } } }, "400": { "description": "Possible errors: Missing draftOwner / Content must not be empty / Content too large / User not found", "content": { "text/plain": { "example": "Content must not be empty" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Draft not found", "content": { "text/plain": { "example": "Draft not found" } } }, "405": { "description": "Method not allowed" } } }, "delete": { "summary": "Delete Draft", "description": "Soft-deletes a draft by setting its deletedAt timestamp.", "tags": [ "Inbox" ], "parameters": [ { "name": "contactId", "in": "path", "required": true, "description": "Contact ID", "example": "ctc_ei6zVayP9B2ugwUPN", "schema": { "type": "string" } }, { "name": "draftId", "in": "path", "required": true, "description": "Draft ID", "example": "drf_abc123def456789", "schema": { "type": "string" } }, { "name": "draftOwner", "in": "query", "required": true, "description": "Draft owner identifier. Accepts either a userId (e.g., `usr_abc123def456789`) or a login email (e.g., `john@acme.com`).", "example": "usr_abc123def456789", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } }, "example": { "success": true } } } }, "400": { "description": "Possible errors: Missing draftOwner / User not found", "content": { "text/plain": { "example": "User not found: neither a valid email nor a valid user id for this team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Draft not found", "content": { "text/plain": { "example": "Draft not found" } } }, "405": { "description": "Method not allowed" } } } }, "/contacts": { "get": { "summary": "Get Many Contacts", "description": "Retrieves contacts by IDs/emails, or searches/lists contacts by name, email, contact list, campaign membership, or company link.\n\nWhen using `idsOrEmails`, returns an array of matching contacts directly.\n\nWhen using `search`, `email`, `listId`, `notInAnyCampaign`, any of the `company*` filters, or no filter at all, returns a paginated response with `data`, `total`, `limit`, and `offset` fields. You can combine filters together to narrow results (e.g. `listId` with `search`, or `notInAnyCampaign` with `companyId`). Calling the endpoint without any filter returns all contacts of the team, paginated.\n\nThe `company*` filters (`companyId`, `companyDomain`, `companyLinkedinUrl`, `companySalesnavUrl`) are mutually exclusive — use only one at a time. `companyDomain` / `companyLinkedinUrl` / `companySalesnavUrl` are resolved to a `companyId` through the Companies collection; if no matching company exists, the endpoint returns an empty list with `total: 0` (not an error), which keeps automation flows simple.", "tags": [ "Contacts" ], "parameters": [ { "name": "idsOrEmails", "in": "query", "required": false, "description": "A comma separated string of either valid contact IDs (MongoDB ObjectId) or valid email addresses. Optional — when omitted, returns the paginated list of all contacts of the team. Maximum 100 values.", "example": "ctc_xW8Ou6C03Csv8vatp,riley@example.com", "schema": { "type": "string" }, "style": "form", "explode": false }, { "name": "search", "in": "query", "required": false, "description": "Search contacts by name or other text fields. Must be at least 2 characters.", "schema": { "type": "string" } }, { "name": "email", "in": "query", "required": false, "description": "Search contacts by exact email address.", "schema": { "type": "string", "format": "email" } }, { "name": "listId", "in": "query", "required": false, "description": "Filter contacts by contact list ID (`clt_xxx` format). Can be combined with `search` or `email`, or used alone to list all contacts in a list. Get valid IDs from `GET /contacts/lists`.", "example": "clt_abc123def456ghi78", "schema": { "type": "string", "pattern": "^clt_[a-zA-Z0-9]+$" } }, { "name": "notInAnyCampaign", "in": "query", "required": false, "description": "When set to `true`, only returns contacts that are not part of any campaign (orphan contacts). Can be used alone or combined with other filters such as `search`, `email`, or `listId`.", "schema": { "type": "boolean" } }, { "name": "companyId", "in": "query", "required": false, "description": "Filter contacts by attached company ID (`cpn_xxx` format). Use this when you already know the lemlist company id (for example after fetching `GET /companies?crmSyncStatus=unique_index_error_company`). Mutually exclusive with `companyDomain`, `companyLinkedinUrl`, and `companySalesnavUrl`.", "example": "cpn_A1B2C3D4E5F6G7H8I", "schema": { "type": "string", "pattern": "^cpn_[a-zA-Z0-9]+$" } }, { "name": "companyDomain", "in": "query", "required": false, "description": "Filter contacts by their company's website domain. Resolved to a `companyId` against the Companies collection. If no company matches, the endpoint returns an empty list (`total: 0`). Mutually exclusive with the other `company*` filters.", "example": "acme.com", "schema": { "type": "string" } }, { "name": "companyLinkedinUrl", "in": "query", "required": false, "description": "Filter contacts by their company's LinkedIn URL. Resolved to a `companyId` against the Companies collection. If no company matches, the endpoint returns an empty list (`total: 0`). Mutually exclusive with the other `company*` filters.", "example": "https://www.linkedin.com/company/acme", "schema": { "type": "string" } }, { "name": "companySalesnavUrl", "in": "query", "required": false, "description": "Filter contacts by their company's LinkedIn Sales Navigator URL. Resolved to a `companyId` against the Companies collection. If no company matches, the endpoint returns an empty list (`total: 0`). Mutually exclusive with the other `company*` filters.", "example": "https://www.linkedin.com/sales/company/12345678", "schema": { "type": "string" } }, { "name": "fieldRejectionReason", "in": "query", "required": false, "description": "Filter contacts to those carrying a field rejection with this reason — a value lemlist refused to write, prefixed by its origin (`enrichment_*` while enriching, `crm_sync_*` during CRM sync). Returns an empty list (`total: 0`) when no contact matches. Each returned contact exposes the full detail under `fieldRejections[]` (which field, why, and `conflictingRecordId` for duplicates). Only applies to the paginated list — ignored when `idsOrEmails` is provided (that path returns the exact contacts requested, unfiltered).", "example": "enrichment_duplicate_linkedin_url", "schema": { "type": "string", "enum": [ "enrichment_duplicate_linkedin_url", "enrichment_duplicate_email", "crm_sync_duplicate_linkedin_url", "crm_sync_invalid_linkedin_url", "crm_sync_invalid_phone", "crm_sync_duplicate_contact_blocked", "crm_sync_duplicate_company_blocked", "crm_sync_company_not_in_lemlist", "crm_sync_custom_field_creation_failed", "crm_sync_value_oscillating", "crm_sync_owner_sync_loop", "crm_sync_unmapped_user", "crm_sync_value_incompatible", "crm_sync_unknown_error" ] } }, { "name": "limit", "in": "query", "required": false, "description": "Maximum number of contacts to return (1–500). Defaults to 100.", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 } }, { "name": "offset", "in": "query", "required": false, "description": "Number of contacts to skip for pagination. Defaults to 0.", "schema": { "type": "integer", "minimum": 0, "default": 0 } } ], "responses": { "200": { "description": "Success. When using `idsOrEmails`, returns an array of contacts. Otherwise, returns a paginated object with `data`, `total`, `limit`, and `offset`.", "content": { "application/json": { "schema": { "oneOf": [ { "type": "array", "items": { "$ref": "#/components/schemas/Contact" } }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Contact" } }, "total": { "type": "integer" }, "limit": { "type": "integer" }, "offset": { "type": "integer" } }, "required": [ "data", "total", "limit", "offset" ] } ] }, "example": [ { "_id": "ctc_xW8Ou6C03Csv8vatp", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "fullName": "John Doe", "email": "support@lemlist.com", "fields": { "firstName": "John", "jobTitle": "Growth Engineer", "lastName": "Doe", "industry": "Technology", "isActiveInCampaigns": false, "lastCampaign": "NEW TO DELETE", "lastLeadMarkedAsInterestedDate": "2025-10-28T02:12:31.971Z", "leadStatus": "Marked as not Interested by api" }, "campaigns": [ { "campaignId": "cam_bSn8EORHQxbWPjHvu", "campaignState": "running", "leadState": "review", "leadId": "lea_fiDpiGV585wy3Oii2" } ], "ownerId": "usr_ahfFktBBHUIxbVG5P", "createdAt": "2025-10-28T00:40:37.917Z", "createdBy": "usr_ahfFktBBHUIxbVG5P", "unsubscribed": false }, { "_id": "ctc_a9RxJNa7pmMd85H9b", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "fullName": "Casey", "email": "riley@example.com", "fields": { "firstName": "Casey", "isActiveInCampaigns": false }, "campaigns": [ { "campaignId": "cam_jwm7THjgGFE3ylR85", "campaignState": "running", "leadState": "done", "leadId": "lea_XKjAytuJhBKZhxhWh" }, { "campaignId": "cam_eF4DlNERV0CW1TwRd", "campaignState": "running", "leadState": "done", "leadId": "lea_fJcS9D3UtEqZcDcAG" }, { "campaignId": "cam_UBbMt30jHq0vNJKJr", "campaignState": "running", "leadState": "done", "leadId": "lea_GlaMfjxlUYuwEDL0w" }, { "campaignId": "cam_pijDVnytN5S7frriD", "campaignState": "running", "leadState": "review", "leadId": "lea_Bs9aMGCcjdzTDvixY" } ], "ownerId": "usr_Emu1g29BMtBixhMSP", "createdAt": "2024-10-01T09:00:13.831Z", "createdBy": "usr_Emu1g29BMtBixhMSP", "unsubscribed": true } ] } } }, "400": { "description": "Possible errors: Bad team / search query too short / invalid listId format", "content": { "text/plain": { "example": "Search query must be at least 2 characters" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } } }, "post": { "summary": "Add and update contact", "description": "Creates a new contact or updates an existing one (upsert). If a contact with the same email, LinkedIn URL, or Sales Navigator URL already exists, it will be updated with the provided non-empty fields. Null or empty values are ignored during updates to preserve existing data. You can target an existing contact directly by providing `contactId`, bypassing email/LinkedIn matching. You can optionally link the contact to a company by providing `companyId`, `companyDomain`, or `companyLinkedinUrl`.", "tags": [ "Contacts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "contactId": { "type": "string", "description": "Existing contact ID. Updates a specific contact by ID, bypassing email/LinkedIn matching. Can only be used to update an existing contact, not to create a new one. When provided, `email` and `linkedinUrl` are not required. At least one of `contactId`, `email`, `linkedinUrl`, or `linkedinUrlSalesNav` is required." }, "email": { "type": "string", "description": "Contact email address. Used as a unique key for upsert matching. At least one of `contactId`, `email`, `linkedinUrl`, or `linkedinUrlSalesNav` is required." }, "linkedinUrl": { "type": "string", "description": "LinkedIn profile URL. Used as an alternative unique key for upsert matching. At least one of `contactId`, `email`, `linkedinUrl`, or `linkedinUrlSalesNav` is required." }, "linkedinUrlSalesNav": { "type": "string", "description": "LinkedIn Sales Navigator profile URL. Used as an alternative unique key for upsert matching." }, "additionalEmails": { "type": "array", "items": { "type": "string" }, "description": "Additional email addresses for the contact. Each must be a valid email address." }, "firstName": { "type": "string", "description": "Contact first name." }, "lastName": { "type": "string", "description": "Contact last name." }, "phone": { "type": "string", "description": "Contact phone number." }, "jobTitle": { "type": "string", "description": "Contact job title. If a company is linked, this is saved as part of the job data." }, "jobDescription": { "type": "string", "description": "Contact job description. If a company is linked, this is saved as part of the job data." }, "picture": { "type": "string", "description": "URL of the contact's profile picture." }, "timezone": { "type": "string", "description": "Contact timezone." }, "industry": { "type": "string", "description": "Contact industry." }, "languages": { "type": "string", "description": "Contact languages." }, "location": { "type": "string", "description": "Contact location." }, "skills": { "type": "string", "description": "Contact skills." }, "summary": { "type": "string", "description": "Contact summary or bio." }, "tagline": { "type": "string", "description": "Contact tagline." }, "contactOwner": { "type": "string", "description": "Owner of the contact. Can be a user ID (e.g. `usr_...`) or a team member's email address. If the provided value does not match a team member, the owner defaults to the API key owner." }, "source": { "type": "string", "description": "Origin of the contact record. Set on creation only and cannot be updated afterwards. Defaults to `api`.", "default": "api" }, "companyId": { "type": "string", "description": "ID of a company already existing in lemlist to link to this contact. Takes priority over `companyDomain` and `companyLinkedinUrl`." }, "companyDomain": { "type": "string", "description": "Domain of a company already existing in lemlist to link to this contact (e.g. `lemlist.com`). Used if `companyId` is not provided." }, "companyLinkedinUrl": { "type": "string", "description": "LinkedIn URL of a company already existing in lemlist to link to this contact. Used if `companyId` and `companyDomain` are not provided." } }, "additionalProperties": { "description": "Any additional key is treated as a custom field. Custom fields must be registered in the team's CRM field registry beforehand." } }, "example": { "email": "jane.smith@example.com", "firstName": "Jane", "lastName": "Smith", "linkedinUrl": "https://linkedin.com/in/janesmith", "jobTitle": "Product Manager", "companyDomain": "acme.com" } } } }, "responses": { "201": { "description": "Contact created successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "data": { "type": "object", "properties": { "_id": { "type": "string", "description": "Unique contact identifier" }, "teamId": { "type": "string", "description": "Team ID" }, "emails": { "type": "array", "description": "Contact email addresses", "items": { "type": "object", "properties": { "value": { "type": "string" } } } }, "linkedinUrl": { "type": "string", "description": "LinkedIn profile URL" }, "linkedinUrlSalesNav": { "type": "string", "description": "LinkedIn Sales Navigator URL" }, "fields": { "type": "object", "description": "Key/value fields (firstName, lastName, phone, jobTitle, custom fields, etc.)", "additionalProperties": true }, "ownerId": { "type": "string", "description": "Owner user ID" }, "companyId": { "type": "string", "description": "Linked company ID (present only when a company was linked)" }, "source": { "type": "string", "description": "Record origin" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "createdBy": { "type": "string", "description": "User ID who created the record" }, "unsubscribed": { "type": "boolean", "description": "Whether the contact is unsubscribed" }, "created": { "type": "boolean", "description": "`true` when a new contact was created, `false` when an existing contact was updated." }, "updated": { "type": "boolean", "description": "Present and set to `true` only when an existing contact was updated (i.e. `created` is `false`)." }, "companyLinked": { "type": "boolean", "description": "Whether a company was successfully linked to the contact." } } }, "warnings": { "type": "array", "description": "Optional warnings (e.g. company resolution issues).", "items": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "example": { "success": true, "data": { "_id": "ctc_xW8Ou6C03Csv8vatp", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "emails": [ { "value": "jane.smith@example.com" } ], "linkedinUrl": "https://www.linkedin.com/in/janesmith", "fields": { "firstName": "Jane", "lastName": "Smith", "jobTitle": "Product Manager" }, "ownerId": "usr_ahfFktBBHUIxbVG5P", "source": "api", "createdAt": "2025-10-28T00:40:37.917Z", "createdBy": "usr_ahfFktBBHUIxbVG5P", "unsubscribed": false, "created": true, "companyLinked": true, "companyId": "cpn_gG7PsmZFpEAnpMCHO" } } } } }, "200": { "description": "Existing contact updated (upsert matched by email or LinkedIn URL)", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "data": { "type": "object", "description": "Same shape as the 201 response, with `created: false` and `updated: true`." } } }, "example": { "success": true, "data": { "_id": "ctc_xW8Ou6C03Csv8vatp", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "emails": [ { "value": "jane.smith@example.com" } ], "fields": { "firstName": "Jane", "lastName": "Smith", "jobTitle": "Product Manager" }, "ownerId": "usr_ahfFktBBHUIxbVG5P", "source": "api", "createdAt": "2025-10-28T00:40:37.917Z", "createdBy": "usr_ahfFktBBHUIxbVG5P", "unsubscribed": false, "created": false, "updated": true, "companyLinked": false } } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "object", "properties": { "code": { "type": "string", "description": "Error code: `MISSING_IDENTIFIER`, `INVALID_CONTACT_ID`, `CONTACT_NOT_FOUND_BY_ID`, `INVALID_EMAIL`, `INVALID_ADDITIONAL_EMAILS`, `INVALID_LINKEDIN_URL`, `INVALID_FIELD`, or `CONTACT_VALIDATION_FAILED`." }, "message": { "type": "string" } } } } }, "example": { "success": false, "error": { "code": "MISSING_IDENTIFIER", "message": "At least one identifier is required: email, linkedinUrl or contactId" } } } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } } }, "parameters": [] } }, "/contacts/{idOrEmail}": { "parameters": [ { "name": "idOrEmail", "in": "path", "required": true, "description": "The unique identifier or email of the contact", "example": "ctc_XXBXpAxmxwg24IzBI", "schema": { "type": "string" } } ], "delete": { "summary": "Delete Contact", "description": "Deletes a lemlist contact resolved by its id (`ctc_xxx`) or email. Cascades to the contact's leads, opportunities, list associations, inbox conversations and activities. **No CRM-side propagation** — only the lemlist record is removed. Fails with `409 CONTACT_DELETE_BLOCKED` when the contact cannot be deleted right now — for example while an enrichment is still running (retry once it finishes); the response `error.message` states the specific reason.", "tags": [ "Contacts" ], "responses": { "200": { "description": "Contact deleted.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "deletedContactId": { "type": "string", "description": "ID of the deleted lemlist contact." } }, "required": [ "success", "deletedContactId" ] }, "example": { "success": true, "deletedContactId": "ctc_xW8Ou6C03Csv8vatp" } } } }, "401": { "description": "The authentication you supplied is incorrect.", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Contact not found (`CONTACT_NOT_FOUND`).", "content": { "application/json": { "example": { "success": false, "error": { "code": "CONTACT_NOT_FOUND", "message": "No contact found with the provided id or email" } } } } }, "409": { "description": "The contact cannot be deleted right now (`CONTACT_DELETE_BLOCKED`) — for example while an enrichment is in progress. The `error.message` states the specific reason; retry once it clears.", "content": { "application/json": { "example": { "success": false, "error": { "code": "CONTACT_DELETE_BLOCKED", "message": "Contact cannot be removed if an enrichment is in progress" } } } } }, "405": { "description": "Method not allowed." } } }, "get": { "summary": "Get Contact", "tags": [ "Contacts" ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Contact" }, "example": { "_id": "ctc_xW8Ou6C03Csv8vatp", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "fullName": "John Doe", "email": "support@lemlist.com", "fields": { "firstName": "John", "jobTitle": "Growth Engineer", "lastName": "Doe", "industry": "Technology", "isActiveInCampaigns": false, "lastCampaign": "NEW TO DELETE", "lastLeadMarkedAsInterestedDate": "2025-10-28T02:12:31.971Z", "leadStatus": "Marked as not Interested by api" }, "campaigns": [ { "campaignId": "cam_bSn8EORHQxbWPjHvu", "campaignState": "running", "leadState": "review", "leadId": "lea_fiDpiGV585wy3Oii2" } ], "ownerId": "usr_ahfFktBBHUIxbVG5P", "createdAt": "2025-10-28T00:40:37.917Z", "createdBy": "usr_ahfFktBBHUIxbVG5P", "unsubscribed": false } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } }, "parameters": [] } }, "/contacts/lists": { "get": { "summary": "Get Contact Lists", "description": "Retrieves all static and dynamic contact lists for the team. Optionally filter by name.", "tags": [ "Contacts" ], "parameters": [ { "name": "search", "in": "query", "required": false, "description": "Filter lists by name (case-insensitive partial match).", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string", "description": "Unique list ID (`clt_xxx` format)" }, "name": { "type": "string", "description": "Name of the contact list" }, "dynamic": { "type": "boolean", "description": "Whether the list is dynamic (auto-populated by filters) or static (manually managed)" } } } }, "example": [ { "_id": "clt_abc123def456ghi78", "name": "Nurturing", "dynamic": false }, { "_id": "clt_xyz789uvw012rst34", "name": "Enterprise Prospects", "dynamic": true } ] } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } } }, "post": { "summary": "Create Contact List", "description": "Creates a new static contact list. After creating the list, use `POST /contacts/lists/{listId}/entities` to add contacts to it.", "tags": [ "Contacts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "maxLength": 200, "description": "Name of the contact list to create (max 200 characters)." } } }, "example": { "name": "Nurturing" } } } }, "responses": { "201": { "description": "Contact list created successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "list": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique list ID (`clt_xxx` format)" }, "name": { "type": "string", "description": "Name of the created list" } } } } }, "example": { "message": "Contact list created successfully", "list": { "id": "clt_abc123def456ghi78", "name": "Nurturing" } } } } }, "400": { "description": "Possible errors: Bad team / name is required / name too long", "content": { "text/plain": { "example": "name is required and must be a non-empty string" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } } } }, "/contacts/lists/{listId}/entities": { "parameters": [ { "name": "listId", "in": "path", "required": true, "description": "The unique identifier of the contact list (`clt_xxx` format). Must be a **static** contact list.", "example": "clt_xxxxxxxxxxxxxxxxx", "schema": { "type": "string", "pattern": "^clt_[a-zA-Z0-9]+$" } } ], "post": { "summary": "Add or Remove Contacts in a List", "description": "Adds existing CRM contacts to a static contact list, or removes them when `?action=remove` is set.\n\n- **Add** (default): send a `POST` with a `contactIds` body. Contacts already in the list are silently skipped (no duplicates) and reported in `alreadyInList`.\n- **Remove**: send a `POST` with `?action=remove` and a `contactIds` body. Contacts that are not in the list are silently skipped; `removedCount` reflects the associations actually removed. This only affects list membership, the contacts are not deleted from your CRM.\n\nThe list must be a **static** contact list (`clt_xxx`). Dynamic lists (auto-populated by filter rules) and company lists are rejected.\n\n**Removal uses `POST ?action=remove` on purpose:** a `DELETE` request body is dropped by our stack, so `DELETE` on this path is **not supported** and returns `405 Method Not Allowed`.", "tags": [ "Contacts" ], "parameters": [ { "name": "action", "in": "query", "required": false, "description": "Omit to **add** the contacts to the list. Set to `remove` to **remove** them from the list.", "example": "remove", "schema": { "type": "string", "enum": [ "remove" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "contactIds" ], "properties": { "contactIds": { "type": "array", "items": { "type": "string", "pattern": "^ctc_[a-zA-Z0-9]+$" }, "minItems": 1, "maxItems": 1000, "description": "Array of contact IDs (`ctc_xxx` format) to add to or remove from the list. Required, non-empty, maximum 1,000 per request." } } }, "example": { "contactIds": [ "ctc_xxxxxxxxxxxxxxxxx", "ctc_yyyyyyyyyyyyyyyyy" ] } } } }, "responses": { "200": { "description": "Contacts added to or removed from the list successfully. The response body depends on `action`.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "addedCount": { "type": "integer", "description": "Number of contacts added to the list (add only)." }, "alreadyInList": { "type": "integer", "description": "Number of contacts that were already in the list and therefore skipped (add only)." }, "removedCount": { "type": "integer", "description": "Number of list associations actually removed (remove only). Contacts that were not in the list are not counted." } } }, "examples": { "add": { "summary": "Add contacts (no action)", "value": { "message": "Contacts added to list successfully", "addedCount": 2, "alreadyInList": 0 } }, "remove": { "summary": "Remove contacts (action=remove)", "value": { "message": "Contacts removed from list successfully", "removedCount": 2 } } } } } }, "400": { "description": "Possible errors: Bad team / Invalid listId format (expected clt_xxx) / contactIds is required and must be a non-empty array / Maximum 1,000 contacts per request / All contactIds must be in ctc_xxx format / List is not a contact list / Cannot manually add contacts to a dynamic list / Cannot manually remove contacts from a dynamic list.", "content": { "text/plain": { "example": "contactIds is required and must be a non-empty array" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Contact list not found", "content": { "text/plain": { "example": "Contact list not found" } } }, "405": { "description": "Method not allowed. `DELETE` on this path is not supported because the request body is dropped by our stack. Use `POST ?action=remove` to remove contacts.", "content": { "text/plain": { "example": "Method not allowed" } } }, "500": { "description": "Internal error while updating the list", "content": { "text/plain": { "example": "Failed to add contacts to list" } } } } } }, "/contacts/export": { "get": { "summary": "Export Contact List", "description": "Exports contacts or companies from a CRM list as a CSV file. The response is streamed as `text/csv` with a `Content-Disposition: attachment` header.\n\nThe exported columns depend on the `entity` type:\n- **contact**: firstName, lastName, email, linkedinUrl, companyName, jobTitle, phone, status, owner, campaigns, contactLists, and more.\n- **company**: name, domain, linkedinUrl, industry, website, status, size, owner, numberOfContacts, companyLists, and more.\n\nCustom fields are included as additional columns.", "tags": [ "Contacts" ], "parameters": [ { "name": "listId", "in": "query", "required": true, "description": "The contact list ID to export (`clt_xxx` format), or `\"all\"` to export all contacts.", "example": "clt_abc123def456ghi78", "schema": { "type": "string" } }, { "name": "entity", "in": "query", "required": false, "description": "The type of entities to export. Defaults to `\"contact\"`.", "schema": { "type": "string", "enum": [ "contact", "company" ], "default": "contact" } } ], "responses": { "200": { "description": "CSV file download", "content": { "text/csv": { "example": "firstName,lastName,email,companyName,jobTitle,status\nJohn,Doe,john@example.com,Acme Inc,CEO,interested" } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "Unauthorized" } } } }, "/lemwarm/{userMailboxId}/start": { "parameters": [ { "name": "userMailboxId", "in": "path", "required": true, "description": "The unique identifier of the user mailbox", "example": "usm_2mkqJNUjnJQiyVBht", "schema": { "type": "string" } } ], "post": { "summary": "Start lemwarm", "tags": [ "lemwarm" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } } }, "example": { "ok": true } } } }, "400": { "description": "Possible errors: Bad team / Error from warmupToggle (invalid-usermailbox, invalid-sender, mailbox-deleted, emailWarmedByAnotherAccount, billing-error, etc.)", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } } } }, "/lemwarm/{userMailboxId}/pause": { "parameters": [ { "name": "userMailboxId", "in": "path", "required": true, "description": "The unique identifier of the user mailbox", "example": "usm_2mkqJNUjnJQiyVBht", "schema": { "type": "string" } } ], "post": { "summary": "Pause lemwarm", "tags": [ "lemwarm" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } } }, "example": { "ok": true } } } }, "400": { "description": "Possible errors: Bad team / Error from warmupToggle", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } } } }, "/lemwarm/{userMailboxId}/settings": { "parameters": [ { "name": "userMailboxId", "in": "path", "required": true, "description": "The unique identifier of the user mailbox", "example": "usm_2mkqJNUjnJQiyVBht", "schema": { "type": "string" } } ], "get": { "summary": "Get lemwarm Settings", "tags": [ "lemwarm" ], "parameters": [], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LemwarmSettings" }, "example": { "warmEmailRampup": 5, "warmEmailMax": 5, "activeAt": "2025-04-10T07:38:31.530Z", "deliverability": { "score": 70, "lastAt": "2025-04-09T13:34:43.998Z" } } } } }, "400": { "description": "Possible errors: Bad team / Error retrieving settings", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } } }, "patch": { "summary": "Update lemwarm Settings", "tags": [ "lemwarm" ], "parameters": [], "requestBody": { "description": "Provide only the fields you want to change; omitted fields keep their current value. At least one field is required.", "content": { "application/json": { "schema": { "type": "object", "minProperties": 1, "properties": { "warmEmailMax": { "type": "integer", "description": "Maximum number of warmup emails per day (0-40; the server enforces 1-40 unless the team has the lemwarm0limit beta)" }, "warmEmailRampup": { "type": "integer", "description": "Daily increase in the warmup email count (0-40; the server enforces 1-40 unless the team has the lemwarm0limit beta)" }, "internalCommunicationPercent": { "type": "integer", "description": "Percentage of warmup emails sent to internal participants (0-100)" }, "answerPercentage": { "type": "integer", "description": "Percentage of warmup emails that should be answered (0-100)" }, "warmUsePlaintext": { "type": "boolean", "description": "Whether warmup emails are sent as plain text" }, "warmDailyVarianceEnabled": { "type": "boolean", "description": "Whether to apply a random daily variance to the warmup email target (spreads volume day-to-day instead of a flat number)" } } }, "example": { "warmEmailMax": 30, "warmEmailRampup": 5, "warmDailyVarianceEnabled": true } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } } }, "example": { "ok": true } } } }, "400": { "description": "Possible errors: Bad team / A provided field has the wrong type / Error updating settings", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } } } }, "/companies": { "get": { "summary": "Get Many Companies", "tags": [ "Companies" ], "parameters": [ { "name": "idsOrDomains", "in": "query", "required": false, "description": "Comma-separated list of company IDs or domains to fetch. When provided, returns only matching companies (no pagination). Each value is classified as a company ID (e.g. `cpn_xxx`) or a domain (e.g. `example.com`). URLs are normalized automatically (e.g. `https://example.com/path` → `example.com`). Invalid values are silently skipped. Maximum 100 values.", "example": "cpn_gG7PsmZFpEAnpMCHO,persana.ai", "schema": { "type": "string" } }, { "name": "offset", "in": "query", "required": false, "description": "Number of companies to skip for pagination. Defaults to 0. Ignored when `idsOrDomains` is provided.", "schema": { "type": "integer", "minimum": 0, "default": 0 } }, { "name": "sortBy", "in": "query", "required": false, "description": "The field by which to sort. Currently, only 'createdAt' is supported.", "example": "createdAt", "schema": { "type": "string", "enum": [ "createdAt" ] } }, { "name": "sortOrder", "in": "query", "required": false, "description": "The sort direction. Use 'desc' for descending order; any other value (or omission) will sort in ascending order.", "example": "desc", "schema": { "type": "string", "enum": [ "asc", "desc" ] } }, { "name": "search", "in": "query", "required": false, "description": "Search by company name (case insensitive)", "example": "lemlist", "schema": { "type": "string" } }, { "name": "fields", "in": "query", "required": false, "description": "Returns selected fields. Returns all fields if empty. Each field is separated by a comma (e.g., '_id,fields.name,domain')", "example": "_id,fields.name,domain", "schema": { "type": "string" } }, { "name": "limit", "in": "query", "required": false, "description": "Number of companies to retrieve. Default: 100. Maximum: 500", "example": "10", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 } }, { "name": "crmSyncStatus", "in": "query", "required": false, "description": "Filter companies by their CRM sync state against the team's active CRM provider. Requires a CRM (Hubspot, Salesforce, or Pipedrive) to be connected — otherwise the request returns `400 NO_CRM_CONNECTED`. Common values:\n- `synced` — the company has a CRM record and no sync errors.\n- `not_synced` — the company has no CRM record yet.\n- `error` — at least one sync error is currently raised.\n- A specific error reason (lowercase form), to filter by root cause: `unique_index_error_company`, `property_doesnt_exist`, `required_field_missing`, `company_already_exists_with_name`, `company_already_exists_with_linkedin_url`.\n\nFor each returned company, see `crmSync.errors[].metadata.alreadyExistingCompanyId` to identify the lemlist company that already occupies the conflicting CRM record (useful to remap contacts before deleting the duplicate).", "example": "unique_index_error_company", "schema": { "type": "string", "enum": [ "synced", "not_synced", "error", "unique_index_error_company", "property_doesnt_exist", "required_field_missing", "company_already_exists_with_name", "company_already_exists_with_linkedin_url" ] } }, { "name": "fieldRejectionReason", "in": "query", "required": false, "description": "Filter companies to those carrying a field rejection with this reason — a value lemlist refused to write, raised during CRM sync (`crm_sync_*`). Returns an empty list (`total: 0`) when no company matches. Each returned company exposes the full detail under `fieldRejections[]` (which field, why, and `conflictingRecordId` for duplicates). Independent of `crmSyncStatus` (which keys off the live provider errors); this filter reads the stored field rejections. Only applies to the paginated list — ignored when `idsOrDomains` is provided (that path returns the exact companies requested, unfiltered).", "example": "crm_sync_duplicate_company", "schema": { "type": "string", "enum": [ "crm_sync_duplicate_company", "crm_sync_invalid_domain", "crm_sync_company_not_found", "crm_sync_update_failed", "crm_sync_duplicate_linkedin_url", "crm_sync_invalid_linkedin_url", "crm_sync_value_oscillating", "crm_sync_owner_sync_loop", "crm_sync_unmapped_user", "crm_sync_value_incompatible", "crm_sync_unknown_error" ] } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Company" } }, "total": { "type": "integer" }, "limit": { "type": "integer" }, "offset": { "type": "integer" } }, "required": [ "data", "total", "limit", "offset" ] }, "example": { "data": [ { "_id": "cpn_gG7PsmZFpEAnpMCHO", "createdAt": "2025-10-26T11:54:27.387Z", "createdBy": "usr_iGBmhLaxZmL0s7k1G", "domain": "persana.ai", "fields": { "name": "Persana AI", "picture": "https://example.com/logos/company-1.png" }, "ownerId": "usr_iGBmhLaxZmL0s7k1G" }, { "_id": "cpn_FEWCjzMWXo5StjpDa", "createdAt": "2025-10-26T11:45:18.773Z", "createdBy": "usr_iGBmhLaxZmL0s7k1G", "domain": "duno.ai", "fields": { "industry": "IT Services and IT Consulting", "name": "Duno.ai", "picture": "https://example.com/logos/company-2.png" }, "ownerId": "usr_iGBmhLaxZmL0s7k1G" }, { "_id": "cpn_2STz8x5Bexmd0nvIz", "createdAt": "2025-10-25T21:37:45.741Z", "createdBy": "usr_iGBmhLaxZmL0s7k1G", "domain": "tally.so", "fields": { "industry": "Computer Software", "name": "lemlist family", "picture": "https://example.com/logos/lemlist.png" }, "ownerId": "usr_iGBmhLaxZmL0s7k1G" }, { "_id": "cpn_Qf4CJuUrNUNmHm6uZ", "createdAt": "2025-10-24T07:26:34.956Z", "createdBy": "usr_ahfFktBBHUIxbVG5P", "domain": "example.com", "fields": { "name": "Growth & GTM Engineering" }, "ownerId": "usr_ahfFktBBHUIxbVG5P" }, { "_id": "cpn_A1B2C3D4E5F6G7H8I", "createdAt": "2025-11-02T09:14:08.512Z", "createdBy": "usr_A1B2C3D4E5F6G7H8I", "domain": "acme.com", "fields": { "name": "Acme Inc" }, "ownerId": "usr_A1B2C3D4E5F6G7H8I", "crmSync": { "provider": "hubspot", "crmRecordId": null, "syncDisabled": false, "errors": [ { "type": "CONNECT_FAILED", "reason": "UNIQUE_INDEX_ERROR_COMPANY", "raisedAt": "2025-11-02T09:14:12.034Z", "metadata": { "alreadyExistingCompanyId": "cpn_J1K2L3M4N5O6P7Q8R" } } ] } } ], "total": 59310, "limit": 100, "offset": 0 } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "405": { "description": "Method not allowed" } } }, "post": { "summary": "Add and update company", "description": "Creates a new company or updates an existing one (upsert). If a company with the same domain, LinkedIn URL, or Sales Navigator URL already exists, it will be updated with the provided non-empty fields. Null or empty values are ignored during updates to preserve existing data. You can target an existing company directly by providing `companyId`, bypassing domain/LinkedIn matching — in that case `name` and `domain` become optional.", "tags": [ "Companies" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "companyId": { "type": "string", "description": "Existing company ID. Updates a specific company by ID, bypassing domain/LinkedIn matching. Can only be used to update an existing company, not to create a new one. When provided, `name` and `domain` become optional." }, "name": { "type": "string", "description": "Company name. Required unless `companyId` is provided." }, "domain": { "type": "string", "description": "Company website domain (e.g. `lemlist.com`). Used as a unique key for upsert matching. Required unless `companyId` is provided." }, "linkedinUrl": { "type": "string", "description": "LinkedIn company page URL. Used as an alternative unique key for upsert matching." }, "linkedinUrlSalesNav": { "type": "string", "description": "LinkedIn Sales Navigator company URL. Used as an alternative unique key for upsert matching." }, "companyOwner": { "type": "string", "description": "Owner of the company. Can be a user ID (e.g. `usr_...`) or a team member's email address. If the provided value does not match a team member, the owner defaults to the API key owner." }, "industry": { "type": "string", "description": "Industry sector of the company." }, "location": { "type": "string", "description": "Geographic location of the company." }, "size": { "type": "string", "description": "Company size." }, "specialties": { "type": "string", "description": "Company specialties." }, "tagline": { "type": "string", "description": "Company tagline." }, "type": { "type": "string", "description": "Company type." }, "description": { "type": "string", "description": "Company description." }, "foundedOn": { "type": "string", "description": "Company founding date." }, "headquarters": { "type": "string", "description": "Company headquarters location." }, "picture": { "type": "string", "description": "URL of the company logo or picture." }, "source": { "type": "string", "description": "Origin of the company record. Set on creation only and cannot be updated afterwards. Defaults to `api`.", "default": "api" } }, "additionalProperties": { "description": "Any additional key is treated as a custom field. Custom fields must be registered in the team's CRM field registry beforehand." } }, "example": { "name": "Acme Corp", "domain": "acme.com", "linkedinUrl": "https://linkedin.com/company/acme", "industry": "Technology", "location": "San Francisco, CA" } } } }, "responses": { "201": { "description": "Company created successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "data": { "type": "object", "properties": { "_id": { "type": "string", "description": "Unique company identifier" }, "teamId": { "type": "string", "description": "Team ID" }, "domain": { "type": "string", "description": "Company domain" }, "linkedinUrl": { "type": "string", "description": "LinkedIn URL" }, "fields": { "type": "object", "description": "Key/value fields (name, picture, industry, location, custom fields, etc.)", "additionalProperties": true }, "ownerId": { "type": "string", "description": "Owner user ID" }, "source": { "type": "string", "description": "Record origin" }, "createdAt": { "type": "string", "format": "date-time", "description": "Creation timestamp" }, "createdBy": { "type": "string", "description": "User ID who created the record" }, "created": { "type": "boolean", "description": "`true` when a new company was created, `false` when an existing company was updated." }, "updated": { "type": "boolean", "description": "Present and set to `true` only when an existing company was updated (i.e. `created` is `false`)." } } }, "warnings": { "type": "array", "description": "Optional warnings (e.g. owner resolution issues).", "items": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } } } } }, "example": { "success": true, "data": { "_id": "cpn_gG7PsmZFpEAnpMCHO", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "domain": "acme.com", "linkedinUrl": "https://www.linkedin.com/company/acme", "fields": { "name": "Acme Corp", "industry": "Technology", "location": "San Francisco, CA" }, "ownerId": "usr_ahfFktBBHUIxbVG5P", "source": "api", "createdAt": "2025-10-28T00:40:37.917Z", "createdBy": "usr_ahfFktBBHUIxbVG5P", "created": true } } } } }, "200": { "description": "Existing company updated (upsert matched by domain or LinkedIn URL)", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "data": { "type": "object", "description": "Same shape as the 201 response, with `created: false` and `updated: true`." } } }, "example": { "success": true, "data": { "_id": "cpn_gG7PsmZFpEAnpMCHO", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "domain": "acme.com", "fields": { "name": "Acme Corp", "industry": "Technology", "location": "San Francisco, CA" }, "ownerId": "usr_ahfFktBBHUIxbVG5P", "source": "api", "createdAt": "2025-10-28T00:40:37.917Z", "createdBy": "usr_ahfFktBBHUIxbVG5P", "created": false, "updated": true } } } } }, "400": { "description": "Validation error", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "object", "properties": { "code": { "type": "string", "description": "Error code: `MISSING_REQUIRED_FIELD`, `INVALID_COMPANY_ID`, `COMPANY_NOT_FOUND_BY_ID`, `INVALID_DOMAIN`, `INVALID_LINKEDIN_URL`, or `INVALID_FIELD`." }, "message": { "type": "string" } } } } }, "example": { "success": false, "error": { "code": "MISSING_REQUIRED_FIELD", "message": "Missing required field: name" } } } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } } }, "parameters": [] } }, "/companies/{companyId}": { "delete": { "summary": "Delete Company", "description": "Deletes a lemlist company. Refuses by default when contacts are still attached — pass `force=true` to detach them (the `companyId` field is unset on each contact) before deleting the company.\n\n**No CRM-side propagation:** only the lemlist record is removed. Designed for the contact-to-company remapping workflow: after reassigning the contacts of a duplicate company to the canonical one (via `POST /contacts/{idOrEmail}`), call this endpoint to drop the now-empty duplicate.", "tags": [ "Companies" ], "parameters": [ { "name": "companyId", "in": "path", "required": true, "description": "The lemlist company ID to delete.", "example": "cpn_A1B2C3D4E5F6G7H8I", "schema": { "type": "string", "pattern": "^cpn_[a-zA-Z0-9]+$" } }, { "name": "force", "in": "query", "required": false, "description": "When `true`, detaches contacts attached to this company (unsets their `companyId`) before deleting it. When omitted or `false`, the request fails with `400 COMPANY_HAS_CONTACTS` if any contact is still attached.", "example": "true", "schema": { "type": "boolean", "default": false } } ], "responses": { "200": { "description": "Company deleted.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "deletedCompanyId": { "type": "string", "description": "ID of the deleted lemlist company." }, "unlinkedContacts": { "type": "integer", "description": "Number of contacts whose `companyId` was unset before deletion. Only present when `force=true`." } }, "required": [ "success", "deletedCompanyId" ] }, "examples": { "no contacts attached": { "value": { "success": true, "deletedCompanyId": "cpn_A1B2C3D4E5F6G7H8I" } }, "force=true with attached contacts": { "value": { "success": true, "deletedCompanyId": "cpn_A1B2C3D4E5F6G7H8I", "unlinkedContacts": 3 } } } } } }, "400": { "description": "Invalid request. Possible error codes: `INVALID_COMPANY_ID` (malformed ID), `COMPANY_HAS_CONTACTS` (contacts still attached and `force` not set).", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "contactCount": { "type": "integer", "description": "Only on `COMPANY_HAS_CONTACTS` — how many contacts are still attached." } } } } }, "example": { "success": false, "error": { "code": "COMPANY_HAS_CONTACTS", "message": "Company still has contacts attached. Pass ?force=true to detach them before deletion. (3 contacts attached)", "contactCount": 3 } } } } }, "401": { "description": "The authentication you supplied is incorrect.", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Company not found (`COMPANY_NOT_FOUND_BY_ID`).", "content": { "application/json": { "example": { "success": false, "error": { "code": "COMPANY_NOT_FOUND_BY_ID", "message": "Company not found by ID" } } } } }, "405": { "description": "Method not allowed." } } } }, "/companies/{companyId}/notes": { "parameters": [ { "name": "companyId", "in": "path", "required": true, "description": "The unique identifier of the company", "example": "cmp_ABC123", "schema": { "type": "string" } } ], "get": { "summary": "Get Company Notes", "tags": [ "Companies" ], "parameters": [ { "name": "limit", "in": "query", "required": false, "description": "Number of notes to retrieve. Default: 100. Maximum: 100", "example": "2", "schema": { "type": "integer" } }, { "name": "page", "in": "query", "required": false, "description": "Page number to retrieve", "example": "1", "schema": { "type": "integer" } }, { "name": "sortBy", "in": "query", "required": false, "description": "The field by which to sort. Currently, only 'createdAt' is supported.", "example": "createdAt", "schema": { "type": "string", "enum": [ "createdAt" ] } }, { "name": "sortOrder", "in": "query", "required": false, "description": "The sort direction. Use 'desc' for descending order; any other value (or omission) will sort in ascending order.", "example": "desc", "schema": { "type": "string", "enum": [ "asc", "desc" ] } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/CompanyNote" } }, "total": { "type": "integer" } }, "required": [ "data", "total" ] }, "example": { "data": [ { "_id": "act_j0NrG6rYEPP9TMmWC", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "companyId": "cpn_Qf4CJuUrNUNmHm6uZ", "createdAt": "2025-10-28T04:25:00.653Z", "note": "could help our GTM team be more productive", "userId": "usr_ahfFktBBHUIxbVG5P" }, { "_id": "act_BYF2j06u0wgeLncub", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "companyId": "cpn_Qf4CJuUrNUNmHm6uZ", "createdAt": "2025-10-24T12:42:40.605Z", "note": "Note created from the API!", "userId": "usr_ahfFktBBHUIxbVG5P" } ], "total": 2 } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Company not found", "content": { "text/plain": { "example": "Company not found" } } }, "405": { "description": "Method not allowed" } } }, "post": { "summary": "Create Company Note", "tags": [ "Companies" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "note": { "type": "string", "description": "The note content" } }, "required": [ "note" ] }, "example": { "note": "Note created from the API!" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompanyNote" }, "example": { "_id": "act_j0NrG6rYEPP9TMmWC", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "companyId": "cpn_Qf4CJuUrNUNmHm6uZ", "type": "annotated", "createdAt": "2025-10-28T04:25:00.653Z", "note": "could help our GTM team be more productive", "sendUserId": "usr_ahfFktBBHUIxbVG5P", "userId": "usr_ahfFktBBHUIxbVG5P" } } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "The authentication you supplied is incorrect", "content": { "text/plain": { "example": "The authentication you supplied is incorrect" } } }, "404": { "description": "Company not found", "content": { "text/plain": { "example": "Company not found" } } }, "405": { "description": "Method not allowed" } }, "parameters": [] } }, "/activities": { "get": { "summary": "Get Many Activities", "tags": [ "Activities" ], "parameters": [ { "name": "version", "in": "query", "required": true, "description": "API version. v2 is mandatory", "example": "v2", "schema": { "type": "string", "enum": [ "v2" ] } }, { "name": "type", "in": "query", "required": false, "description": "Filter by activity type (e.g., paused)", "example": "paused", "schema": { "type": "string" } }, { "name": "campaignId", "in": "query", "required": false, "description": "Filter by campaign ID", "example": "cam_123", "schema": { "type": "string" } }, { "name": "isFirst", "in": "query", "required": false, "description": "Filter for first activity", "example": "true", "schema": { "type": "boolean" } }, { "name": "offset", "in": "query", "required": false, "description": "Number of records to skip. Note: This is not traditional cursor-based pagination. To retrieve all activities, increment offset by the limit value on each request (e.g., offset=0, then offset=100, then offset=200, etc.).", "example": "0", "schema": { "type": "integer" } }, { "name": "limit", "in": "query", "required": false, "description": "Number of activities to retrieve. Default: 100. Maximum: 100", "example": "2", "schema": { "type": "integer" } }, { "name": "leadId", "in": "query", "required": false, "description": "Filter by lead ID", "example": "lea_123", "schema": { "type": "string" } }, { "name": "minDate", "in": "query", "required": false, "description": "Filter activities by `createdAt >= minDate`. Accepts either a Unix timestamp in seconds (e.g. `1715385600`) or an ISO 8601 datetime (e.g. `2026-05-11T00:00:00Z`). `minDate` is the primary name; `startDate` is accepted as an alias and `minDate` takes precedence when both are provided.", "example": "2026-05-01T00:00:00Z", "schema": { "type": "string" } }, { "name": "maxDate", "in": "query", "required": false, "description": "Filter activities by `createdAt <= maxDate`. Accepts either a Unix timestamp in seconds (e.g. `1715385600`) or an ISO 8601 datetime (e.g. `2026-05-11T00:00:00Z`). Must be strictly greater than `minDate` when both are provided. `maxDate` is the primary name; `endDate` is accepted as an alias and `maxDate` takes precedence when both are provided.", "example": "2026-05-31T23:59:59Z", "schema": { "type": "string" } }, { "name": "startDate", "in": "query", "required": false, "description": "Alias for `minDate`, provided for consistency with sibling endpoints (e.g. `/campaigns/{campaignId}/stats`). Accepts either a Unix timestamp in seconds or an ISO 8601 datetime. Ignored when `minDate` is also provided.", "example": "2026-05-01T00:00:00Z", "schema": { "type": "string" } }, { "name": "endDate", "in": "query", "required": false, "description": "Alias for `maxDate`, provided for consistency with sibling endpoints (e.g. `/campaigns/{campaignId}/stats`). Accepts either a Unix timestamp in seconds or an ISO 8601 datetime. Ignored when `maxDate` is also provided.", "example": "2026-05-31T23:59:59Z", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Activity" } }, "example": [ { "_id": "act_PbKqTGpQqSlPcoOZ5", "type": "manualDone", "userId": "usr_Emu1g29BMtBixhMSP", "userName": "Guillaume Moubeche", "bot": false, "createdAt": "2025-10-28T08:07:38.375Z", "leadFirstName": "John", "leadLastName": "Doe", "leadEmail": "support@lemlist.com", "leadCompanyName": "Acme Inc", "leadId": "lea_fiDpiGV585wy3Oii2", "contactId": "ctc_xW8Ou6C03Csv8vatp", "campaignId": "cam_bSn8EORHQxbWPjHvu", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "opportunityId": "opp_LyXDV8KHzctQdLFpG", "metaData": { "teamId": "tea_8QvkOiBfPdb2ZRhHi", "campaignId": "cam_bSn8EORHQxbWPjHvu", "leadId": "lea_fiDpiGV585wy3Oii2", "type": "manualDone" }, "lead": { "_id": "lea_fiDpiGV585wy3Oii2", "isPaused": false, "state": "manualNotInterested", "personalized": false, "source": "api", "variables": { "firstName": "John", "lastName": "Doe", "companyName": "Acme Inc", "jobTitle": "Growth Engineer", "companyDomain": "example.com", "email": "support@lemlist.com", "preferredContactMethod": "email", "industry": "Technology", "Company name": "John Doe" }, "contactId": "ctc_xW8Ou6C03Csv8vatp", "enrichment": { "emailStatus": "deliverable" } }, "campaignName": "NEW TO DELETE", "sequenceTested": "B" }, { "_id": "act_j0NrG6rYEPP9TMmWC", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "companyId": "cpn_Qf4CJuUrNUNmHm6uZ", "type": "annotated", "createdAt": "2025-10-28T04:25:00.653Z", "note": "could help our GTM team be more productive", "sendUserId": "usr_ahfFktBBHUIxbVG5P", "userId": "usr_ahfFktBBHUIxbVG5P" }, { "_id": "act_WeKrlIaQlBnM3LZ6G", "type": "manualNotInterested", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "userName": "api", "isFirst": false, "bot": false, "createdAt": "2025-10-28T02:14:34.834Z", "name": "NEW TO DELETE", "leadFirstName": "John", "leadLastName": "Doe", "leadEmail": "support@lemlist.com", "leadCompanyName": "Acme Inc", "leadId": "lea_fiDpiGV585wy3Oii2", "contactId": "ctc_xW8Ou6C03Csv8vatp", "campaignId": "cam_bSn8EORHQxbWPjHvu", "metaData": { "teamId": "tea_8QvkOiBfPdb2ZRhHi", "campaignId": "cam_bSn8EORHQxbWPjHvu", "leadId": "lea_fiDpiGV585wy3Oii2", "type": "manualNotInterested" }, "lead": { "_id": "lea_fiDpiGV585wy3Oii2", "isPaused": false, "state": "manualNotInterested", "personalized": false, "source": "api", "variables": { "firstName": "John", "lastName": "Doe", "companyName": "Acme Inc", "jobTitle": "Growth Engineer", "companyDomain": "example.com", "email": "support@lemlist.com", "preferredContactMethod": "email", "industry": "Technology", "Company name": "John Doe" }, "contactId": "ctc_xW8Ou6C03Csv8vatp", "enrichment": { "emailStatus": "deliverable" } }, "campaignName": "NEW TO DELETE", "sequenceTested": "B" }, { "_id": "act_zktTG4HXXXSOQya5U", "type": "paused", "userName": "api", "bot": false, "createdAt": "2025-10-28T01:54:56.099Z", "name": "NEW TO DELETE", "leadFirstName": "John", "leadLastName": "Doe", "leadEmail": "support@lemlist.com", "leadCompanyName": "Acme Inc", "leadId": "lea_fiDpiGV585wy3Oii2", "contactId": "ctc_xW8Ou6C03Csv8vatp", "campaignId": "cam_bSn8EORHQxbWPjHvu", "teamId": "tea_8QvkOiBfPdb2ZRhHi", "metaData": { "teamId": "tea_8QvkOiBfPdb2ZRhHi", "campaignId": "cam_bSn8EORHQxbWPjHvu", "leadId": "lea_fiDpiGV585wy3Oii2", "type": "paused" }, "lead": { "_id": "lea_fiDpiGV585wy3Oii2", "isPaused": false, "state": "manualNotInterested", "personalized": false, "source": "api", "variables": { "firstName": "John", "lastName": "Doe", "companyName": "Acme Inc", "jobTitle": "Growth Engineer", "companyDomain": "example.com", "email": "support@lemlist.com", "preferredContactMethod": "email", "industry": "Technology", "Company name": "John Doe" }, "contactId": "ctc_xW8Ou6C03Csv8vatp", "enrichment": { "emailStatus": "deliverable" } }, "campaignName": "NEW TO DELETE", "sequenceTested": "B" }, { "_id": "act_x6esGLhoPa2SMHCZ7", "type": "emailsOpened", "isFirst": false, "stopped": false, "createdAt": "2025-10-27T20:20:59.696Z", "bot": false, "teamId": "tea_8QvkOiBfPdb2ZRhHi", "leadId": "lea_wj47uWhDbbN6Qq6oT", "campaignId": "cam_oxeGg6paG3ZVxjHkH", "sequenceId": "seq_ODjsLXkxXiySRw6dK", "sequenceStep": 1, "emailTemplateId": "etp_z3nAbjdHuewVEjIl5", "createdBy": "usr_EvXz6JqPSJJL9lHkp", "sendUserId": "usr_EvXz6JqPSJJL9lHkp", "name": "Unicorn campaign", "leadFirstName": "Sam", "leadLastName": "Taylor", "leadEmail": "sam@example.com", "leadCompanyName": "lemlist", "contactId": "ctc_FkeUdQHEfhqG2HMbK", "relatedSentAt": "2020-12-07T11:49:14.830Z", "metaData": { "teamId": "tea_8QvkOiBfPdb2ZRhHi", "campaignId": "cam_oxeGg6paG3ZVxjHkH", "leadId": "lea_wj47uWhDbbN6Qq6oT", "type": "emailsOpened", "createdBy": "usr_EvXz6JqPSJJL9lHkp", "taskId": "tsk_namMcIQnA6gxQIupP" }, "lead": { "_id": "lea_wj47uWhDbbN6Qq6oT", "isPaused": false, "state": "emailsUnsubscribed", "personalized": false, "source": "manually", "variables": { "firstName": "Sam ", "lastName": "Taylor", "email": "sam@example.com", "companyName": "lemlist", "linkedinUrl": "https://www.linkedin.com/in/sam-doe" }, "contactId": "ctc_FkeUdQHEfhqG2HMbK", "enrichment": {} }, "campaignName": "Unicorn campaign", "sequenceTested": "A", "emailTemplateName": "Blank" }, { "_id": "act_q4tnlXNdXsBeQceYW", "type": "emailsOpened", "isFirst": false, "stopped": false, "createdAt": "2025-10-27T20:17:24.119Z", "bot": false, "teamId": "tea_8QvkOiBfPdb2ZRhHi", "leadId": "lea_wj47uWhDbbN6Qq6oT", "campaignId": "cam_oxeGg6paG3ZVxjHkH", "sequenceId": "seq_ODjsLXkxXiySRw6dK", "sequenceStep": 1, "emailTemplateId": "etp_z3nAbjdHuewVEjIl5", "createdBy": "usr_EvXz6JqPSJJL9lHkp", "sendUserId": "usr_EvXz6JqPSJJL9lHkp", "name": "Unicorn campaign", "leadFirstName": "Sam", "leadLastName": "Taylor", "leadEmail": "sam@example.com", "leadCompanyName": "lemlist", "contactId": "ctc_FkeUdQHEfhqG2HMbK", "relatedSentAt": "2020-12-07T11:49:14.830Z", "metaData": { "teamId": "tea_8QvkOiBfPdb2ZRhHi", "campaignId": "cam_oxeGg6paG3ZVxjHkH", "leadId": "lea_wj47uWhDbbN6Qq6oT", "type": "emailsOpened", "createdBy": "usr_EvXz6JqPSJJL9lHkp", "taskId": "tsk_namMcIQnA6gxQIupP" }, "lead": { "_id": "lea_wj47uWhDbbN6Qq6oT", "isPaused": false, "state": "emailsUnsubscribed", "personalized": false, "source": "manually", "variables": { "firstName": "Sam ", "lastName": "Taylor", "email": "sam@example.com", "companyName": "lemlist", "linkedinUrl": "https://www.linkedin.com/in/sam-doe" }, "contactId": "ctc_FkeUdQHEfhqG2HMbK", "enrichment": {} }, "campaignName": "Unicorn campaign", "sequenceTested": "A", "emailTemplateName": "Blank" } ] } } }, "400": { "description": "Bad team", "content": { "text/plain": { "example": "Bad team" } } }, "401": { "description": "Unauthorized" } } } }, "/activities/{activityId}/recording-transcript": { "delete": { "summary": "Delete Activity Recording & Transcript", "tags": [ "Activities" ], "parameters": [ { "name": "activityId", "in": "path", "required": true, "description": "Unique activity ID", "example": "act_123", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean", "example": true } } } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Activity not found or has no recording", "content": { "text/plain": { "example": "Activity not found" } } }, "405": { "description": "Method not allowed" }, "500": { "description": "Error while deleting recording or transcript" } } } }, "/v2/campaigns/{campaignId}/stats": { "get": { "summary": "Get Campaign Stats", "tags": [ "Campaigns" ], "description": "Retrieve detailed statistics for a specific campaign, with filtering options by date, user, A/B testing, and communication channels.", "parameters": [ { "name": "campaignId", "in": "path", "required": true, "description": "Unique campaign ID", "example": "cam_123", "schema": { "type": "string" } }, { "name": "startDate", "in": "query", "required": true, "description": "Start date in ISO 8601 format", "example": "2024-01-07T22:00:00.000Z", "schema": { "type": "string", "format": "date-time" } }, { "name": "endDate", "in": "query", "required": true, "description": "End date in ISO 8601 format", "example": "2025-07-10T21:59:59.999Z", "schema": { "type": "string", "format": "date-time" } }, { "name": "sendUser", "in": "query", "required": false, "description": "Filter stats by send user. Format: `sendUserId|sendUserEmail`. The sendUserId should begin with 'usr_' and the sendUserEmail should be a valid sender email. If the param is specified, both sendUserId and sendUserEmail are mandatory.", "example": "usr_OcIHizJyIeaDxicQP|email@example.com", "schema": { "type": "string" } }, { "name": "ABSelected", "in": "query", "required": false, "description": "A/B version filter", "example": "A", "schema": { "type": "string", "enum": [ "A", "B" ] } }, { "name": "channels", "in": "query", "required": false, "description": "JSON array of channels to include. Possible values: 'email', 'linkedin', 'others'", "example": "[\"others\", \"linkedin\", \"email\"]", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "nbLeads": { "type": "integer", "description": "Total number of leads in the campaign" }, "nbLeadsLaunched": { "type": "integer", "description": "Number of leads launched in the campaign" }, "nbLeadsReached": { "type": "integer", "description": "Number of leads that were successfully reached" }, "nbLeadsOpened": { "type": "integer", "description": "Number of leads that opened messages" }, "nbLeadsInteracted": { "type": "integer", "description": "Number of leads that interacted with messages (clicked, replied)" }, "nbLeadsAnswered": { "type": "integer", "description": "Number of leads that answered" }, "nbLeadsInterested": { "type": "integer", "description": "Number of leads marked as interested" }, "nbLeadsNotInterested": { "type": "integer", "description": "Number of leads marked as not interested" }, "nbLeadsUnsubscribed": { "type": "integer", "description": "Number of leads that unsubscribed" }, "nbLeadsInterrupted": { "type": "integer", "description": "Number of leads with interrupted sequences" }, "messagesSent": { "type": "integer", "description": "Total number of messages sent" }, "messagesNotSent": { "type": "integer", "description": "Number of messages that failed to send" }, "messagesBounced": { "type": "integer", "description": "Number of messages that bounced" }, "delivered": { "type": "integer", "description": "Number of messages successfully delivered" }, "opened": { "type": "integer", "description": "Number of messages opened" }, "clicked": { "type": "integer", "description": "Number of messages with clicks" }, "replied": { "type": "integer", "description": "Number of messages that received replies" }, "invitationAccepted": { "type": "integer", "description": "Number of LinkedIn invitations accepted" }, "meetingBooked": { "type": "integer", "description": "Number of meetings booked" }, "steps": { "type": "array", "description": "Detailed metrics for each step in the campaign", "items": { "type": "object", "properties": { "index": { "type": "integer", "description": "Step index in the sequence" }, "sequenceId": { "type": "string", "description": "ID of the sequence" }, "sequenceStep": { "type": "integer", "description": "Step number within the sequence" }, "abTest": { "type": "string", "description": "A/B test variant (if applicable)" }, "taskType": { "type": "string", "description": "Type of task", "enum": [ "email", "linkedinVisit", "linkedinInvite", "linkedinSend", "phone", "manual", "conditional" ] }, "conditionLabel": { "type": "string", "description": "Label for conditional steps" }, "invited": { "type": "integer", "description": "Number of LinkedIn invitations sent" }, "sent": { "type": "integer", "description": "Number of messages sent" }, "delivered": { "type": "integer", "description": "Number of messages delivered" }, "opened": { "type": "integer", "description": "Number of messages opened" }, "clicked": { "type": "integer", "description": "Number of clicks from a message from this step" }, "replied": { "type": "integer", "description": "Number of replies" }, "notDelivered": { "type": "integer", "description": "Number of messages not delivered" }, "bounced": { "type": "integer", "description": "Number of messages bounced" }, "unsubscribed": { "type": "integer", "description": "Number of unsubscribes from this step" } } } } } }, "example": { "nbLeads": 32, "nbLeadsLaunched": 32, "nbLeadsReached": 32, "nbLeadsOpened": 31, "nbLeadsInteracted": 4, "nbLeadsAnswered": 16, "nbLeadsInterested": 1, "nbLeadsNotInterested": 0, "nbLeadsUnsubscribed": 1, "nbLeadsInterrupted": 1, "messagesSent": 72, "messagesNotSent": 0, "messagesBounced": 0, "delivered": 72, "opened": 47, "clicked": 4, "replied": 16, "invitationAccepted": 0, "meetingBooked": 0, "steps": [ { "index": 1, "sequenceId": "seq_rH5RD3fMkkt2gM3YC", "sequenceStep": 0, "taskType": "linkedinSend", "invited": 0, "sent": 32, "delivered": 32, "opened": 15, "clicked": 0, "replied": 15, "notDelivered": 0, "bounced": 0, "unsubscribed": 1 }, { "index": 2, "sequenceId": "seq_rH5RD3fMkkt2gM3YC", "sequenceStep": 1, "invited": 0, "sent": 20, "delivered": 20, "opened": 17, "clicked": 1, "replied": 1, "notDelivered": 0, "bounced": 0, "unsubscribed": 0 }, { "index": 3, "sequenceId": "seq_rH5RD3fMkkt2gM3YC", "sequenceStep": 2, "invited": 0, "sent": 20, "delivered": 20, "opened": 15, "clicked": 3, "replied": 0, "notDelivered": 0, "bounced": 0, "unsubscribed": 0 } ] } } } }, "400": { "description": "Bad request - Invalid parameters", "content": { "text/plain": { "examples": { "badTeam": { "summary": "Bad team", "value": "Bad team" }, "missingDates": { "summary": "Missing dates", "value": "Bad params: startDate and endDate are required" }, "invalidChannels": { "summary": "Invalid channels format", "value": "Bad params: channels must be a valid array" }, "invalidChannelValues": { "summary": "Invalid channel values", "value": "Bad params: channels must be empty or contain \"others\", \"email\" or \"linkedin\"" }, "invalidAB": { "summary": "Invalid A/B selection", "value": "Bad params: ABSelected must be A or B" }, "invalidSendUserFormat": { "summary": "Invalid send user format", "value": "Bad param format: sendUser must be formatted as follow: