Skip to main content
The CLI stores credentials as profiles. A profile holds either an OAuth token set or an API key, and each one resolves to exactly one lemlist account. The simplest way in: log in with your browser. No key to copy.
The consent screen lets you pick the team for each login, so one profile is bound to one account. Tokens refresh automatically shortly before they expire; when the session fully expires, run lemlist auth login again.

Log in with an API key

Get your API key from lemlist (Settings → Team → Integrations → Generate), then store it under a profile name:

Managing several accounts

Store one profile per team, then switch between them.
Override the active profile for a single call, or through an environment variable:

See the team behind each profile

Profile names are yours to choose, so auth list alone doesn’t tell you which lemlist team a credential actually points to. Add --verbose to resolve each profile against the API and show the team name, its id, and its member count:
Each profile is resolved independently: a profile whose credential has expired is reported inline (as above) without aborting the others. Add --json for a structured array — each entry carries profile, active, credential, and either a team object or an error string.
--verbose makes one API call per profile (GET /team), so it needs network access — and for OAuth profiles it may silently refresh an expired token. Plain lemlist auth list stays fully offline.

How the credential is resolved

For each call, the CLI resolves which credential to use in this order:
  1. The --key <key> flag — a raw API key that bypasses profiles entirely.
  2. The profile named by the --account <name> flag.
  3. The LEMLIST_PROFILE environment variable.
  4. The active profile set with lemlist auth use.
  5. The default profile.
Profiles are stored in ~/.lemlist/config.json with file mode 0600. The file holds either an API key or an OAuth token set per profile — keep it as secure as a password.

Command reference


give us feedback on this page