Skip to main content
The CLI exposes two ways to reach the API: a generic escape hatch that reaches any endpoint, and named subcommands for the common flows. Both are derived from the lemlist OpenAPI specification, so a new endpoint surfaces without a CLI release.

Discover the surface

The spec is fetched once and cached locally (one-hour TTL). On a brand-new machine, run lemlist endpoints once to populate the cache before the named subcommands appear.

Call any endpoint

lemlist api <method> <path> accepts any endpoint the live spec declares — including endpoints added after your CLI version shipped. Query strings in the path are forwarded as query parameters; request bodies go through --data as JSON.
A path absent from the spec is rejected with an UNKNOWN_ENDPOINT error (exit code 5) and the closest matching endpoints as suggestions. Run lemlist endpoints --refresh if you expect a newly deployed endpoint.

Named subcommands

Every endpoint is also exposed as a named subcommand, grouped by resource:
Run lemlist --help for the full list, and lemlist <group> --help for the actions of one group.
  • Path parameters become positional arguments.
  • Query parameters become --<name> flags.
  • Request bodies always go through --data.
Group and action names are derived from the spec’s tags and operation ids, with path heuristics as a fallback — so the examples above are illustrative, not guaranteed. Run lemlist <group> --help to see the exact names your version generated. Everything not covered by a named subcommand is still reachable through lemlist api.

Global flags

These flags apply to every command:
give us feedback on this page