Skip to main content
lofty-cli supports four authentication methods. They are evaluated in priority order at every command invocation: the first one that yields a valid access token wins. Pick the method that fits how you are running the CLI.
Tokens obtained by Token URL, Browser OAuth, and Client Credentials are cached locally and refreshed automatically when they expire.
Use this when an upstream system can mint a session ID and exchange it for tokens through a custom endpoint.
You can also pass the values inline:
Tokens are cached at ~/.config/tokens/lofty-session-cache.json and refreshed transparently.
Use this for server-to-server scenarios where there is no human to complete a browser flow. Implements the OAuth 2.0 Client Credentials Grant with an additional resource owner identifier.
1

Register an OAuth application

Sign in to the Lofty Developer Portal to create an application and obtain your client_id and client_secret.
2

Configure client credentials

3

Specify the target account

The customer key identifies which Lofty account’s data the CLI will access (the resource owner). Each Lofty user has a unique API key — find it in the Lofty CRM under Settings > Integrations > API.
4

Exchange for an access token

Unlike a standard Client Credentials Grant where the client acts on its own behalf, Lofty requires LOFTY_CUSTOMER_KEY to specify which account to access. The token is scoped to that account’s data and permissions.
When another system has already obtained an access token (e.g. a CI job that ran auth login upstream), inject it directly:
No auth login* command is required; the token is used as-is.

Verifying authentication

Logging out

This deletes the Token URL cache, the PKCE token, the OAuth refresh cache, and the saved customer key. It does not revoke server-side sessions — for that, rotate the credential at its source.

Where credentials live on disk

Never commit any of these files to source control. Use auth logout or remove the directory to wipe state.

Troubleshooting

If auth test fails, see Troubleshooting for the common causes (clock skew, expired refresh token, wrong customer key, missing scope).