### Install Smartlead CLI Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Instructions for installing the Smartlead CLI globally via npm, running it via npx, or downloading the binary for Linux/macOS systems. ```bash npm install -g @smartlead/cli npx @smartlead/cli campaigns list curl -L -o smartlead https://github.com/Smartlead-Public/smartlead-cli/releases/latest/download/smartlead-linux-x64 chmod +x smartlead sudo mv smartlead /usr/local/bin/ ``` -------------------------------- ### Get Overall Lead Statistics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves overall lead statistics and metrics within a date range. ```bash # Get lead stats smartlead analytics lead-stats --from 2025-01-01 --to 2025-01-31 ``` -------------------------------- ### Control CLI Output Formats Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Demonstrates how to specify output formats like JSON, table, or CSV using the --format flag. Includes examples of piping JSON output to tools like jq for data transformation and batch processing. ```bash # JSON output (default when piped) smartlead campaigns list --format json # Table output (default in terminal) smartlead campaigns list --format table # CSV output for spreadsheets smartlead campaigns list --format csv > campaigns.csv # Pipe to jq for JSON processing smartlead campaigns list | jq '.[].name' # Pipe to other commands smartlead campaigns list | jq -r '.[].id' | while read id; do smartlead stats campaign --id "$id" done ``` -------------------------------- ### Analytics Overall Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Get comprehensive overall analytics stats across all campaigns with extensive filtering options. ```APIDOC ## GET /analytics/overall ### Description Retrieves detailed overall analytics across all campaigns, supporting date ranges, timezones, client filtering, and full data retrieval. ### Method GET ### Endpoint /analytics/overall ### Parameters #### Query Parameters - **from** (string) - Required - The start date for the range (YYYY-MM-DD). - **to** (string) - Required - The end date for the range (YYYY-MM-DD). - **timezone** (string) - Optional - The timezone for date calculations (e.g., 'America/New_York'). - **client-ids** (string) - Optional - Comma-separated list of client IDs to filter by. - **full-data** (boolean) - Optional - If true, returns more detailed analytics. Defaults to false. ### Request Example ```bash smartlead analytics overall --from 2025-01-01 --to 2025-01-31 smartlead analytics overall --from 2025-01-01 --to 2025-01-31 \ --timezone America/New_York \ --client-ids 1,2,3 \ --full-data true ``` ### Response #### Success Response (200) - **total_sent** (integer) - Total emails sent. - **total_opens** (integer) - Total unique opens. - **total_replies** (integer) - Total unique replies. - **total_unsubscribes** (integer) - Total unsubscribes. - **total_bounces** (integer) - Total bounces. - **detailed_stats** (object, optional) - Contains more granular data if `full-data` is true. #### Response Example ```json { "total_sent": 100000, "total_opens": 25000, "total_replies": 5000, "total_unsubscribes": 100, "total_bounces": 200, "detailed_stats": { "open_rate": 0.25, "reply_rate": 0.05 } } ``` ``` -------------------------------- ### Stats Top Level Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Get top-level analytics across all campaigns for a specified date range. ```APIDOC ## GET /stats/top-level ### Description Provides aggregated statistics across all campaigns within a given date range. ### Method GET ### Endpoint /stats/top-level ### Parameters #### Query Parameters - **from** (string) - Required - The start date for the range (YYYY-MM-DD). - **to** (string) - Required - The end date for the range (YYYY-MM-DD). - **campaign-ids** (string) - Optional - A comma-separated list of campaign IDs to filter by. ### Request Example ```bash smartlead stats top-level --from 2025-01-01 --to 2025-01-31 smartlead stats top-level --from 2025-01-01 --to 2025-01-31 --campaign-ids 123,456,789 ``` ### Response #### Success Response (200) - **total_sent** (integer) - Total emails sent across all specified campaigns. - **total_opens** (integer) - Total unique opens. - **total_replies** (integer) - Total unique replies. - **total_unsubscribes** (integer) - Total unsubscribes. - **total_bounces** (integer) - Total bounces. #### Response Example ```json { "total_sent": 50000, "total_opens": 12000, "total_replies": 2500, "total_unsubscribes": 50, "total_bounces": 100 } ``` ``` -------------------------------- ### Stats Mailboxes Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Get mailbox-level statistics for a campaign, with options for limiting results and filtering by date. ```APIDOC ## GET /stats/mailboxes ### Description Retrieves performance statistics aggregated at the mailbox level for a given campaign. ### Method GET ### Endpoint /stats/mailboxes ### Parameters #### Query Parameters - **id** (integer) - Required - The unique identifier of the campaign. - **limit** (integer) - Optional - The maximum number of mailbox records to return. - **start-date** (string) - Optional - The start date for filtering mailbox activity (YYYY-MM-DD). - **end-date** (string) - Optional - The end date for filtering mailbox activity (YYYY-MM-DD). ### Request Example ```bash smartlead stats mailboxes --id 12345 --limit 20 smartlead stats mailboxes --id 12345 --start-date 2025-01-01 --end-date 2025-01-31 ``` ### Response #### Success Response (200) - **campaign_id** (integer) - The ID of the campaign. - **mailbox_stats** (array) - An array of mailbox statistics objects. - **mailbox_id** (string) - The unique identifier for the mailbox. - **sent_count** (integer) - Number of emails sent from this mailbox. - **open_rate** (float) - The open rate for emails sent from this mailbox. - **reply_rate** (float) - The reply rate for emails sent from this mailbox. - **bounce_rate** (float) - The bounce rate for emails sent from this mailbox. #### Response Example ```json { "campaign_id": 12345, "mailbox_stats": [ { "mailbox_id": "mbx_1", "sent_count": 500, "open_rate": 0.25, "reply_rate": 0.05, "bounce_rate": 0.01 }, { "mailbox_id": "mbx_2", "sent_count": 450, "open_rate": 0.28, "reply_rate": 0.06, "bounce_rate": 0.005 }, ... ] } ``` ``` -------------------------------- ### Get Daily Reply Analytics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves day-wise positive reply statistics within a date range. Also provides a command to get reply stats grouped by sent time. ```bash # Get daily reply stats smartlead analytics daily-replies --from 2025-01-01 --to 2025-01-31 # Reply stats by sent time smartlead analytics daily-replies-sent --from 2025-01-01 --to 2025-01-31 --timezone America/New_York ``` -------------------------------- ### Analytics Client Stats Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Get client-wise performance statistics within a date range, with filtering capabilities. ```APIDOC ## GET /analytics/client-stats ### Description Retrieves performance statistics aggregated on a per-client basis within a specified date range. Allows filtering based on client attributes. ### Method GET ### Endpoint /analytics/client-stats ### Parameters #### Query Parameters - **from** (string) - Required - The start date for the range (YYYY-MM-DD). - **to** (string) - Required - The end date for the range (YYYY-MM-DD). - **filter** (string) - Optional - A filter string to apply to client data (e.g., 'enterprise', 'SMB'). ### Request Example ```bash smartlead analytics client-stats --from 2025-01-01 --to 2025-01-31 smartlead analytics client-stats --from 2025-01-01 --to 2025-01-31 --filter "enterprise" ``` ### Response #### Success Response (200) - **client_performance** (array) - An array of client performance objects. - **client_id** (integer) - The ID of the client. - **client_name** (string) - The name of the client. - **total_sent** (integer) - Total emails sent by the client. - **total_opens** (integer) - Total unique opens for the client. ``` -------------------------------- ### Stats Campaign Range Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Get campaign analytics within a specified date range. ```APIDOC ## GET /stats/campaign-range ### Description Retrieves performance statistics for a campaign over a defined date range. ### Method GET ### Endpoint /stats/campaign-range ### Parameters #### Query Parameters - **id** (integer) - Required - The unique identifier of the campaign. - **from** (string) - Required - The start date for the range (YYYY-MM-DD). - **to** (string) - Required - The end date for the range (YYYY-MM-DD). - **time-zone** (string) - Optional - The timezone to use for date calculations (e.g., 'America/New_York'). ### Request Example ```bash smartlead stats campaign-range --id 12345 --from 2025-01-01 --to 2025-01-31 smartlead stats campaign-range --id 12345 --from 2025-01-01 --to 2025-01-31 --time-zone America/New_York ``` ### Response #### Success Response (200) - **campaign_id** (integer) - The ID of the campaign. - **start_date** (string) - The start date of the range. - **end_date** (string) - The end date of the range. - **sent_count** (integer) - Total emails sent within the range. - **open_count** (integer) - Unique opens within the range. - **reply_count** (integer) - Unique replies within the range. #### Response Example ```json { "campaign_id": 12345, "start_date": "2025-01-01", "end_date": "2025-01-31", "sent_count": 500, "open_count": 120, "reply_count": 25 } ``` ``` -------------------------------- ### Get Lead Response Categories Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves lead responses grouped by category within a date range. ```bash # Get category breakdown smartlead analytics lead-categories --from 2025-01-01 --to 2025-01-31 ``` -------------------------------- ### Get Email Provider Performance Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves email provider-wise overall performance metrics within a date range. ```bash # Get provider performance smartlead analytics provider-perf --from 2025-01-01 --to 2025-01-31 ``` -------------------------------- ### Analytics Daily Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Get day-wise overall stats for trend analysis within a specified date range. ```APIDOC ## GET /analytics/daily ### Description Provides daily aggregated statistics across all campaigns for trend analysis within a given date range. Supports filtering by campaign IDs. ### Method GET ### Endpoint /analytics/daily ### Parameters #### Query Parameters - **from** (string) - Required - The start date for the range (YYYY-MM-DD). - **to** (string) - Required - The end date for the range (YYYY-MM-DD). - **campaign-ids** (string) - Optional - A comma-separated list of campaign IDs to filter by. ### Request Example ```bash smartlead analytics daily --from 2025-01-01 --to 2025-01-31 smartlead analytics daily --from 2025-01-01 --to 2025-01-31 --campaign-ids 123,456 ``` ### Response #### Success Response (200) - **daily_stats** (array) - An array of daily statistics objects. - **date** (string) - The date for the daily statistics. - **sent_count** (integer) - Emails sent on that date. - **open_count** (integer) - Unique opens on that date. - **reply_count** (integer) - Unique replies on that date. #### Response Example ```json { "daily_stats": [ { "date": "2025-01-01", "sent_count": 1000, "open_count": 250, "reply_count": 50 }, { "date": "2025-01-02", "sent_count": 1100, "open_count": 270, "reply_count": 55 }, ... ] } ``` ``` -------------------------------- ### Analytics Campaign Stats Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Get campaign-wise performance statistics within a date range, with pagination support. ```APIDOC ## GET /analytics/campaign-stats ### Description Retrieves performance statistics aggregated on a per-campaign basis within a specified date range. Supports pagination for large result sets. ### Method GET ### Endpoint /analytics/campaign-stats ### Parameters #### Query Parameters - **from** (string) - Required - The start date for the range (YYYY-MM-DD). - **to** (string) - Required - The end date for the range (YYYY-MM-DD). - **limit** (integer) - Optional - The maximum number of campaign records to return per page. Defaults to 20. - **offset** (integer) - Optional - The number of records to skip for pagination. Defaults to 0. ### Request Example ```bash smartlead analytics campaign-stats --from 2025-01-01 --to 2025-01-31 smartlead analytics campaign-stats --from 2025-01-01 --to 2025-01-31 --limit 50 --offset 0 ``` ### Response #### Success Response (200) - **campaign_performance** (array) - An array of campaign performance objects. - **campaign_id** (integer) - The ID of the campaign. - **campaign_name** (string) - The name of the campaign. - **sent_count** (integer) - Total emails sent for the campaign. - **open_rate** (float) - The open rate for the campaign. - **reply_rate** (float) - The reply rate for the campaign. - **pagination** (object) - **limit** (integer) - The limit used for the request. - **offset** (integer) - The offset used for the request. - **total_results** (integer) - The total number of campaigns matching the criteria. #### Response Example ```json { "campaign_performance": [ { "campaign_id": 123, "campaign_name": "Q1 Outreach", "sent_count": 5000, "open_rate": 0.22, "reply_rate": 0.04 }, { "campaign_id": 456, "campaign_name": "Product Launch", "sent_count": 7500, "open_rate": 0.25, "reply_rate": 0.06 }, ... ], "pagination": { "limit": 50, "offset": 0, "total_results": 150 } } ``` ``` -------------------------------- ### Analytics Daily Sent Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Get day-wise stats grouped by sent time for trend analysis. ```APIDOC ## GET /analytics/daily-sent ### Description Provides daily statistics aggregated by the time emails were sent, useful for analyzing sending patterns and their impact. ### Method GET ### Endpoint /analytics/daily-sent ### Parameters #### Query Parameters - **from** (string) - Required - The start date for the range (YYYY-MM-DD). - **to** (string) - Required - The end date for the range (YYYY-MM-DD). - **timezone** (string) - Optional - The timezone to use for date calculations (e.g., 'America/New_York'). ### Request Example ```bash smartlead analytics daily-sent --from 2025-01-01 --to 2025-01-31 --timezone America/New_York ``` ### Response #### Success Response (200) - **daily_sent_stats** (array) - An array of daily statistics objects grouped by sent time. - **date** (string) - The date for the statistics. - **hour** (integer) - The hour of the day (0-23). - **sent_count** (integer) - Emails sent during that hour on that date. - **open_rate** (float) - Average open rate for emails sent during that hour. - **reply_rate** (float) - Average reply rate for emails sent during that hour. #### Response Example ```json { "daily_sent_stats": [ { "date": "2025-01-01", "hour": 9, "sent_count": 100, "open_rate": 0.30, "reply_rate": 0.06 }, { "date": "2025-01-01", "hour": 10, "sent_count": 120, "open_rate": 0.28, "reply_rate": 0.05 }, ... ] } ``` ``` -------------------------------- ### Stats Leads Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Get lead-level statistics for a specific campaign, with options for limiting results and filtering by event time. ```APIDOC ## GET /stats/leads ### Description Retrieves statistics aggregated at the lead level for a given campaign. ### Method GET ### Endpoint /stats/leads ### Parameters #### Query Parameters - **id** (integer) - Required - The unique identifier of the campaign. - **limit** (integer) - Optional - The maximum number of lead records to return. - **event-time-gt** (string) - Optional - Filter leads with events occurring after this ISO 8601 timestamp (e.g., '2025-01-01T00:00:00Z'). ### Request Example ```bash smartlead stats leads --id 12345 --limit 100 smartlead stats leads --id 12345 --event-time-gt 2025-01-01T00:00:00Z ``` ### Response #### Success Response (200) - **campaign_id** (integer) - The ID of the campaign. - **lead_stats** (array) - An array of lead statistics objects. - **lead_id** (string) - The unique identifier for the lead. - **sent_count** (integer) - Number of emails sent to this lead. - **open_count** (integer) - Number of times emails were opened by this lead. - **reply_count** (integer) - Number of replies from this lead. #### Response Example ```json { "campaign_id": 12345, "lead_stats": [ { "lead_id": "lead_abc", "sent_count": 5, "open_count": 2, "reply_count": 1 }, { "lead_id": "lead_def", "sent_count": 5, "open_count": 1, "reply_count": 0 }, ... ] } ``` ``` -------------------------------- ### Analytics Daily Replies Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Get day-wise positive reply statistics, with an option to group by sent time. ```APIDOC ## GET /analytics/daily-replies ### Description Provides daily statistics focused on positive replies, allowing analysis of reply trends. Can also group replies by sent time. ### Method GET ### Endpoint /analytics/daily-replies ### Parameters #### Query Parameters - **from** (string) - Required - The start date for the range (YYYY-MM-DD). - **to** (string) - Required - The end date for the range (YYYY-MM-DD). - **timezone** (string) - Optional - The timezone to use for date calculations (e.g., 'America/New_York'). ### Request Example ```bash smartlead analytics daily-replies --from 2025-01-01 --to 2025-01-31 smartlead analytics daily-replies-sent --from 2025-01-01 --to 2025-01-31 --timezone America/New_York ``` ### Response #### Success Response (200) - **daily_reply_stats** (array) - An array of daily reply statistics objects. - **date** (string) - The date for the statistics. - **reply_count** (integer) - Number of positive replies received on that date. - **reply_rate** (float) - The reply rate for that date. - **hour** (integer, optional) - The hour of the day if grouped by sent time. #### Response Example ```json { "daily_reply_stats": [ { "date": "2025-01-01", "reply_count": 50, "reply_rate": 0.05 }, { "date": "2025-01-02", "reply_count": 55, "reply_rate": 0.052 }, ... ] } ``` ``` -------------------------------- ### Get Client Performance Statistics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves client-wise performance statistics within a date range. Supports filtering by client name or type. ```bash # Get client performance smartlead analytics client-stats --from 2025-01-01 --to 2025-01-31 # With filter smartlead analytics client-stats --from 2025-01-01 --to 2025-01-31 --filter "enterprise" ``` -------------------------------- ### Get Lead-Level Statistics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves lead-level statistics for a specific campaign. Supports limiting results and filtering by event time. ```bash # Get lead statistics smartlead stats leads --id 12345 --limit 100 # Get events after specific time smartlead stats leads --id 12345 --event-time-gt 2025-01-01T00:00:00Z ``` -------------------------------- ### Get Overall Analytics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves comprehensive overall analytics across all campaigns within a date range. Supports timezone, client filtering, and fetching full data. ```bash # Get overall analytics smartlead analytics overall --from 2025-01-01 --to 2025-01-31 # With full data and filters smartlead analytics overall --from 2025-01-01 --to 2025-01-31 \ --timezone America/New_York \ --client-ids 1,2,3 \ --full-data true ``` -------------------------------- ### Get Campaign Performance Statistics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves campaign-wise performance statistics within a date range. Supports pagination with limit and offset parameters. ```bash # Get campaign performance smartlead analytics campaign-stats --from 2025-01-01 --to 2025-01-31 # With pagination smartlead analytics campaign-stats --from 2025-01-01 --to 2025-01-31 --limit 50 --offset 0 ``` -------------------------------- ### GET /campaigns/sequence-analytics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves performance metrics for a campaign's sequences within a specified date range. ```APIDOC ## GET /campaigns/sequence-analytics ### Description Fetches analytics data for sequences within a campaign. ### Method GET ### Endpoint smartlead campaigns sequence-analytics ### Parameters #### Query Parameters - **id** (integer) - Required - Campaign ID - **start-date** (string) - Required - YYYY-MM-DD - **end-date** (string) - Required - YYYY-MM-DD - **time-zone** (string) - Optional - IANA timezone string ``` -------------------------------- ### Get Team Board Performance Stats Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves team board overall statistics for team performance tracking within a date range. ```bash # Get team stats smartlead analytics team-board --from 2025-01-01 --to 2025-01-31 ``` -------------------------------- ### Get Mailbox-Level Statistics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves mailbox-level statistics for a campaign. Supports limiting results and filtering by a date range. ```bash # Get mailbox performance smartlead stats mailboxes --id 12345 --limit 20 # With date filter smartlead stats mailboxes --id 12345 --start-date 2025-01-01 --end-date 2025-01-31 ``` -------------------------------- ### Get Daily Overall Analytics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves day-wise overall statistics for trend analysis within a date range. Can be filtered by campaign IDs. ```bash # Get daily stats smartlead analytics daily --from 2025-01-01 --to 2025-01-31 # Filter by campaigns smartlead analytics daily --from 2025-01-01 --to 2025-01-31 --campaign-ids 123,456 ``` -------------------------------- ### Stats Top Level Range Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Get day-wise overall stats for a date range, useful for trend analysis. ```APIDOC ## GET /stats/top-level-range ### Description Provides daily aggregated statistics across all campaigns for a specified date range, including timezone support. ### Method GET ### Endpoint /stats/top-level-range ### Parameters #### Query Parameters - **from** (string) - Required - The start date for the range (YYYY-MM-DD). - **to** (string) - Required - The end date for the range (YYYY-MM-DD). - **timezone** (string) - Optional - The timezone to use for daily aggregation (e.g., 'America/New_York'). ### Request Example ```bash smartlead stats top-level-range --from 2025-01-01 --to 2025-01-31 --timezone America/New_York ``` ### Response #### Success Response (200) - **daily_stats** (array) - An array of daily statistics objects. - **date** (string) - The date for the daily statistics. - **sent_count** (integer) - Emails sent on that date. - **open_count** (integer) - Unique opens on that date. - **reply_count** (integer) - Unique replies on that date. #### Response Example ```json { "daily_stats": [ { "date": "2025-01-01", "sent_count": 1000, "open_count": 250, "reply_count": 50 }, { "date": "2025-01-02", "sent_count": 1100, "open_count": 270, "reply_count": 55 }, ... ] } ``` ``` -------------------------------- ### Get Day-Wise Top-Level Analytics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves day-wise overall statistics for a given date range, useful for trend analysis. Supports timezone specification. ```bash # Get daily breakdown smartlead stats top-level-range --from 2025-01-01 --to 2025-01-31 --timezone America/New_York ``` -------------------------------- ### Get Top-Level Campaign Analytics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves top-level analytics across all campaigns within a specified date range. Can filter by a list of campaign IDs. ```bash # Get overall stats smartlead stats top-level --from 2025-01-01 --to 2025-01-31 # Filter by campaigns smartlead stats top-level --from 2025-01-01 --to 2025-01-31 --campaign-ids 123,456,789 ``` -------------------------------- ### Get Campaign Analytics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves analytics for a specific campaign using its ID. The output can be formatted as JSON for further processing. ```bash # Get campaign analytics smartlead stats campaign --id 12345 # View as formatted JSON smartlead stats campaign --id 12345 --format json | jq '{sent: .sent_count, opens: .open_count, replies: .reply_count}' ``` -------------------------------- ### Get Domain Health Metrics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves domain-wise health metrics for sender reputation monitoring within a date range. Supports fetching full data. ```bash # Get domain health smartlead analytics domain-health --from 2025-01-01 --to 2025-01-31 --full-data true ``` -------------------------------- ### Get Campaign Analytics for Date Range Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves campaign analytics for a specified date range. Supports filtering by campaign ID and specifying a timezone. ```bash # Get analytics for date range smartlead stats campaign-range --id 12345 --from 2025-01-01 --to 2025-01-31 # With timezone smartlead stats campaign-range --id 12345 --from 2025-01-01 --to 2025-01-31 --time-zone America/New_York ``` -------------------------------- ### Get Daily Analytics by Sent Time Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves day-wise analytics grouped by sent time within a date range. Supports timezone specification. ```bash # Stats by sent time smartlead analytics daily-sent --from 2025-01-01 --to 2025-01-31 --timezone America/New_York ``` -------------------------------- ### Get Mailbox Health Metrics Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Retrieves mailbox health metrics, including bounce rates and deliverability, within a date range. Can filter to show only bounced mailboxes. ```bash # Get mailbox health smartlead analytics mailbox-health --from 2025-01-01 --to 2025-01-31 # Filter bounced mailboxes smartlead analytics mailbox-health --from 2025-01-01 --to 2025-01-31 --is-bounced true ``` -------------------------------- ### Manage Clients and API Keys Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Handles client account creation and API key lifecycle management, including listing, creating, resetting, and deleting keys. ```bash # List clients smartlead clients list # Create client cat > client.json << 'EOF' { "email": "client@example.com", "name": "Enterprise Client", "company": "Enterprise Inc" } EOF smartlead clients create --from-json client.json # Create API key smartlead clients create-key --client-id 42 --key-name "Production-Key" # List keys smartlead clients keys --client-id 42 --status active # Delete API key smartlead clients delete-key --key-id 999 --confirm # Reset API key smartlead clients reset-key --key-id 999 ``` -------------------------------- ### POST /leads/add Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Adds a list of new leads to a specific campaign using a JSON configuration file. ```APIDOC ## POST /leads/add ### Description Bulk import leads into a campaign. ### Method POST ### Endpoint smartlead leads add ### Parameters #### Request Body - **campaign-id** (integer) - Required - Target Campaign ID - **from-json** (file) - Required - JSON file containing lead list and import settings ### Request Example { "lead_list": [{"email": "john@example.com", "first_name": "John"}], "settings": {"ignore_global_block_list": false} } ``` -------------------------------- ### Configure Authentication Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Manage API key authentication using configuration files, environment variables, or command-line flags to secure API access. ```bash smartlead config set api_key sl-xxxxxxxxxxxxxxxx smartlead config get api_key export SMARTLEAD_API_KEY=sl-xxxxxxxxxxxxxxxx smartlead --api-key sl-xxx campaigns list smartlead config list smartlead config clear ``` -------------------------------- ### Perform Prospect Database Lookups and Searches Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Commands to query prospect metadata like industries, job titles, and locations, as well as searching for specific contacts. These tools help in filtering and identifying potential leads. ```bash # Search departments smartlead prospect departments --query "Sales" # Search companies smartlead prospect companies --query "Acme" --limit 20 # Search prospects cat > search.json << 'EOF' { "job_titles": ["VP Sales", "Director of Sales"], "industries": [1, 2, 3], "headcounts": [4, 5], "countries": ["US", "UK"], "limit": 100 } EOF smartlead prospect search --from-json search.json ``` -------------------------------- ### Manage Campaign Webhooks Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Provides commands to list, create, update, delete, summarize, and retrigger campaign webhooks. Configuration can be passed via JSON files. ```bash # List campaign webhooks smartlead webhooks list --campaign-id 12345 # Configure webhook cat > webhook.json << 'EOF' { "name": "Lead Reply Notification", "webhook_url": "https://api.example.com/webhooks/smartlead", "event_types": ["EMAIL_SENT", "EMAIL_REPLIED", "EMAIL_BOUNCED"] } EOF smartlead webhooks upsert --campaign-id 12345 --from-json webhook.json # Delete webhook smartlead webhooks delete --campaign-id 12345 --webhook-id 789 --confirm # Get webhook summary smartlead webhooks summary --campaign-id 12345 --from 2025-01-01T00:00:00Z --to 2025-01-31T23:59:59Z # Retrigger failed webhooks smartlead webhooks retrigger --campaign-id 12345 --from 2025-01-01T00:00:00Z --to 2025-01-31T23:59:59Z ``` -------------------------------- ### Manage and list leads using Smartlead CLI Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Provides commands to list, filter, and paginate leads within specific campaigns or across all campaigns. Supports CSV/JSON output formats. ```bash smartlead leads list --campaign-id 12345 smartlead leads list --campaign-id 12345 --status INPROGRESS smartlead leads list --campaign-id 12345 --limit 50 --offset 100 smartlead leads list --campaign-id 12345 --all smartlead leads list-all --all --format json > all-leads.json ``` -------------------------------- ### Lead Management CLI Commands Source: https://github.com/smartlead-public/smartlead-cli/blob/master/README.md Commands for updating lead revenue, categories, and task/note management using the SmartLead CLI. ```bash smartlead inbox update-revenue --lead-id ID --revenue 5000 smartlead inbox update-category --lead-id ID --category-id 3 smartlead inbox create-task --from-json task.json smartlead inbox create-note --from-json note.json smartlead inbox block-domains --from-json domains.json smartlead inbox resume-lead --lead-id ID --campaign-id ID smartlead inbox read-status --lead-id ID --read true|false smartlead inbox set-reminder --from-json reminder.json smartlead inbox push-subsequence --from-json subseq.json smartlead inbox assign-member --from-json member.json ``` -------------------------------- ### CLI Error Handling in Scripts Source: https://github.com/smartlead-public/smartlead-cli/blob/master/README.md Demonstrates how to handle specific exit codes from the SmartLead CLI to provide meaningful feedback in automation scripts. ```bash #!/bin/bash if ! smartlead campaigns get --id 99999 2>/dev/null; then case $? in 2) echo "Auth failed — check your API key" ;; 3) echo "Campaign not found" ;; *) echo "Unknown error" ;; esac exit 1 fi ``` -------------------------------- ### Add and update leads using Smartlead CLI Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Imports new leads via JSON or updates existing lead information and categories. Allows for pausing or resuming lead activity. ```bash cat > leads.json << 'EOF' { "lead_list": [ { "email": "john@example.com", "first_name": "John", "last_name": "Doe" } ] } EOF smartlead leads add --campaign-id 12345 --from-json leads.json smartlead leads update --campaign-id 12345 --lead-id 67890 --from-json update.json smartlead leads pause --campaign-id 12345 --lead-id 67890 smartlead leads resume --campaign-id 12345 --lead-id 67890 --delay-days 3 ``` -------------------------------- ### Implement CLI Error Handling and Retries Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Shows how to handle specific exit codes from the Smartlead CLI in bash scripts to manage authentication, resource, and rate-limit errors. Also demonstrates the use of the --retry flag for automatic rate-limit handling. ```bash #!/bin/bash set -euo pipefail # Exit codes: # 0 - Success # 1 - General error # 2 - Authentication failure # 3 - Resource not found # 4 - Rate limited if ! smartlead campaigns get --id 99999 2>/dev/null; then case $? in 2) echo "Auth failed - check your API key" ;; 3) echo "Campaign not found" ;; 4) echo "Rate limited - try again later" ;; *) echo "Unknown error" ;; esac exit 1 fi # Enable automatic retry on rate limit smartlead --retry campaigns list ``` -------------------------------- ### Configure campaign settings using Smartlead CLI Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Updates campaign settings using a JSON configuration file. Requires a valid campaign ID and a properly formatted JSON file containing tracking and unsubscribe preferences. ```bash cat > settings.json << 'EOF' { "track_settings": ["DONT_TRACK_EMAIL_OPEN", "DONT_TRACK_LINK_CLICK"], "stop_lead_settings": "REPLY_TO_AN_EMAIL", "unsubscribe_text": "Click here to unsubscribe", "send_as_plain_text": false } EOF smartlead campaigns update-settings --id 12345 --from-json settings.json ``` -------------------------------- ### POST /campaigns/update-settings Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Updates the configuration settings for a specific campaign, including tracking preferences and unsubscribe behavior. ```APIDOC ## POST /campaigns/update-settings ### Description Updates tracking, stop-lead settings, and unsubscribe text for a campaign. ### Method POST ### Endpoint smartlead campaigns update-settings ### Parameters #### Request Body - **id** (integer) - Required - Campaign ID - **from-json** (file) - Required - Path to JSON file containing settings ### Request Example { "track_settings": ["DONT_TRACK_EMAIL_OPEN", "DONT_TRACK_LINK_CLICK"], "stop_lead_settings": "REPLY_TO_AN_EMAIL", "unsubscribe_text": "Click here to unsubscribe", "send_as_plain_text": false } ``` -------------------------------- ### Prospect Search and Enrichment Source: https://github.com/smartlead-public/smartlead-cli/blob/master/README.md Utility commands for querying prospect data including departments, industries, and job titles, as well as managing saved searches. ```bash smartlead prospect departments --query "Sales" smartlead prospect cities --query "San" --country "US" smartlead prospect countries smartlead prospect states --country "US" smartlead prospect industries --with-sub-industry true smartlead prospect sub-industries --industry-id 5 smartlead prospect headcounts smartlead prospect levels smartlead prospect revenue smartlead prospect companies --query "Acme" smartlead prospect domains --query "acme" smartlead prospect job-titles --query "VP" smartlead prospect keywords --query "SaaS" smartlead prospect search --from-json search.json smartlead prospect fetch --from-json fetch.json smartlead prospect get --from-json get.json smartlead prospect find-emails --from-json contacts.json smartlead prospect review --filter-id 123 ``` -------------------------------- ### Manage Inbox and Leads Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Operations for fetching replies, managing inbox views (unread, snoozed, etc.), replying, forwarding, and updating lead metadata. ```bash # Fetch replies smartlead inbox replies --limit 20 # Get inbox entry smartlead inbox lead --id 12345 # Reply to thread cat > reply.json << 'EOF' { "campaign_id": 12345, "email_stats_id": 67890, "email_body": "Thank you for your response!", "reply_from": "sender@company.com" } EOF smartlead inbox reply --from-json reply.json # Update lead revenue smartlead inbox update-revenue --lead-id 12345 --revenue 5000 # Update category smartlead inbox update-category --lead-id 12345 --category-id 3 ``` -------------------------------- ### Fetch and Manage Prospect Contact Data Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Commands to retrieve contact details, find emails based on domain, and manage saved search configurations. Note that fetching contacts may consume platform credits. ```bash # Fetch contacts cat > fetch.json << 'EOF' { "filter_id": 12345, "limit": 50 } EOF smartlead prospect fetch --from-json fetch.json # Find emails cat > contacts.json << 'EOF' { "contacts": [ { "firstName": "John", "lastName": "Doe", "companyDomain": "acme.com" } ] } EOF smartlead prospect find-emails --from-json contacts.json # Save a search cat > save.json << 'EOF' { "search_string": "Enterprise SaaS Leads", "job_titles": ["VP Sales"], "industries": [1, 2] } EOF smartlead prospect save-search --from-json save.json ``` -------------------------------- ### Manage Email Sequences Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Save and retrieve email sequences for specific campaigns using JSON configuration files to define outreach flows. ```bash smartlead campaigns save-sequence --id 12345 --from-json sequences.json smartlead campaigns get-sequence --id 12345 ``` -------------------------------- ### Create a subsequence using Smartlead CLI Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Adds a branching subsequence to an existing campaign. Requires a JSON file defining the sequence structure and delay details. ```bash cat > subsequence.json << 'EOF' { "name": "Follow-up for Interested Leads", "sequences": [ { "seq_number": 1, "seq_delay_details": { "delay_in_days": 1 }, "subject": "Great to hear from you!", "email_body": "Hi {{first_name}},\n\nThank you for your interest..." } ] } EOF smartlead campaigns create-subsequence --id 12345 --from-json subsequence.json ``` -------------------------------- ### POST /leads/update Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Updates the details of an existing lead within a campaign. ```APIDOC ## POST /leads/update ### Description Updates lead information such as name, company, or custom fields. ### Method POST ### Endpoint smartlead leads update ### Parameters #### Request Body - **campaign-id** (integer) - Required - Campaign ID - **lead-id** (integer) - Required - Lead ID - **from-json** (file) - Required - JSON file with updated fields ``` -------------------------------- ### Lookup leads by email using Smartlead CLI Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Searches for lead information across all campaigns using an email address as the primary identifier. ```bash smartlead leads get-by-email --email user@example.com ``` -------------------------------- ### Manage Inbox Tasks and Lead Status via Smartlead CLI Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Commands to create tasks, notes, reminders, and manage lead states such as resume, read status, and team assignments. These operations typically require a JSON configuration file for complex data inputs. ```bash # Create task cat > task.json << 'EOF' { "email_lead_map_id": 12345, "name": "Follow up call", "description": "Schedule discovery call", "priority": "high", "due_date": "2025-02-15T10:00:00Z" } EOF smartlead inbox create-task --from-json task.json # Create note cat > note.json << 'EOF' { "email_lead_map_id": 12345, "note_message": "Interested in enterprise plan. Follow up next week." } EOF smartlead inbox create-note --from-json note.json # Resume lead smartlead inbox resume-lead --lead-id 12345 --campaign-id 67890 # Mark as read smartlead inbox read-status --lead-id 12345 --read true # Set reminder cat > reminder.json << 'EOF' { "email_lead_map_id": 12345, "email_stats_id": 67890, "message": "Follow up on proposal", "reminder_time": "2025-02-01T09:00:00Z" } EOF smartlead inbox set-reminder --from-json reminder.json ``` -------------------------------- ### Manage Campaigns Source: https://context7.com/smartlead-public/smartlead-cli/llms.txt Perform CRUD operations on campaigns including listing, retrieving details, creating new campaigns, and updating statuses, schedules, and settings. ```bash smartlead campaigns list smartlead campaigns list --client-id 42 --include-tags smartlead campaigns get --id 12345 smartlead campaigns create --name "Q1 Outreach Campaign" smartlead campaigns set-status --id 12345 --status START smartlead campaigns update-schedule --id 12345 --from-json schedule.json ```