Skip to main content

Smartlead platform CLI

Project description

smartlead-cli

smartlead-cli provides a smartlead command for working with the Smartlead API from a terminal.

It follows the same project structure as plane-cli and wildberries-cli: Typer commands, a shared config layer, JSON-first output, and a raw command for full API coverage.

Install

pip install smartlead-cli

Authentication

Smartlead uses an API key passed as api_key query parameter. Configure it once:

smartlead config init

You can also override at runtime:

SMARTLEAD_API_KEY=... smartlead campaigns list

Config

Config file path:

  • ~/.config/smartlead-cli/config.toml

Supported keys (examples):

  • core.api_key
  • core.base_url
  • core.timeout_seconds
  • core.retries
  • defaults.limit

Examples:

smartlead config show
smartlead config set core.timeout_seconds 30
smartlead config set core.retries 3
smartlead config set defaults.limit 100

Commands (v1)

  • config - manage local config
  • campaigns - list/get/create/delete/update status + analytics/statistics + campaign leads
  • leads - a few global lead operations
  • webhooks - campaign webhook helpers
  • raw - direct API access for unsupported endpoints

Examples

smartlead campaigns list
smartlead campaigns get 12345
smartlead campaigns create --name "New Campaign"
smartlead campaigns status 12345 --status PAUSED
smartlead campaigns statistics 12345 --limit 50 --offset 0
smartlead campaigns analytics top 12345
smartlead campaigns analytics by-date 12345 --start-date 2025-01-01 --end-date 2025-01-31

Campaign leads:

smartlead campaigns leads list 12345
smartlead campaigns leads add 12345 --body-file leads.json
smartlead campaigns leads update 12345 67890 --body-file lead-update.json
smartlead campaigns leads pause 12345 67890
smartlead campaigns leads resume 12345 67890 --delay-days 2
smartlead campaigns leads unsubscribe 12345 67890
smartlead campaigns leads delete 12345 67890 --yes
smartlead campaigns leads message-history 12345 67890

Global lead helpers:

smartlead leads get-by-email --email person@example.com
smartlead leads unsubscribe-all 67890

Campaign webhooks:

smartlead webhooks list 12345
smartlead webhooks upsert 12345 --body-file webhook.json
smartlead webhooks delete 12345 --webhook-id 555 --yes

Raw endpoint access (fallback for full API surface):

smartlead raw request --method GET --path /campaigns
smartlead raw request --method POST --path /campaigns/12345/status --query status=PAUSED
smartlead raw request --method POST --path /campaigns/12345/leads --body-file leads.json

Output

  • Default output is JSON on stdout
  • Errors are structured JSON on stderr
  • Use --pretty for Rich tables on selected list commands

Publishing to PyPI

The repo includes a GitHub Actions workflow (.github/workflows/publish.yml) for trusted publishing on tags matching v*.

Notes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smartlead_cli-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smartlead_cli-0.1.1-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file smartlead_cli-0.1.1.tar.gz.

File metadata

  • Download URL: smartlead_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for smartlead_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cccdfaf0fc49f2901487e9f3df805543a4a074c49d99b5b652848561b2150e03
MD5 1ad6b6f55a3ec89af7ac8bd02cd8069a
BLAKE2b-256 f356a7bb781e3115b9e9c9e78560ef67f1dab4d2c08c673188db09351dd778a6

See more details on using hashes here.

File details

Details for the file smartlead_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: smartlead_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for smartlead_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 478cd8e2d10a425f2b348fb1c76c5d3dfe95b6567ac8d7312fe139b1549860f0
MD5 451cf5ff86b39821b9e0eb202697a265
BLAKE2b-256 77e0f57204b7593c78e96942111e04b0497fbbf66973ffb0b2a8b764ee2b419b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page