> ## Documentation Index
> Fetch the complete documentation index at: https://developers.usezend.app/llms.txt
> Use this file to discover all available pages before exploring further.

# zend login

> Pair the CLI with your Zend account by approving it on your phone.

```bash theme={null}
zend login
```

This is the only way to authenticate. No flag or prompt accepts a typed API key.

**1. The CLI starts a pairing session**

It prints an approval link and a QR code.

**2. Open it on your phone**

The link opens in the Zend app, on an approval screen that names this CLI (`zend-cli on <hostname>`).

**3. Approve**

Tap **Approve** and confirm it's you.

**4. The CLI saves its key**

The CLI notices the approval, fetches its API key, and saves it to `~/.zend/config.json` with `0600` permissions.

```text theme={null}
$ zend login

Approve this login in the Zend App:

  https://zdfi.me/cli-auth/aB3xK9mP2qR7sT1vW4yZ0

  █▀▀▀▀▀█ ▀ █▀█ █▀▀▀▀▀█
  █ ███ █ ▄▄▄▄▄ █ ███ █
  █ ▀▀▀ █ █▄█▀▀ █ ▀▀▀ █
  ▀▀▀▀▀▀▀ ▀▀▀▀▀ ▀▀▀▀▀▀▀

Waiting for approval (expires at 2026-07-06T14:32:00Z)...
....
Logged in! Your API key has been saved to ~/.zend/config.json.
```

## When it doesn't finish

| Output | Meaning |
| - | - |
| `Login was denied in the Zend App.` | You tapped deny. Nothing was saved |
| `Pairing session expired before it was approved.` | Sessions last 10 minutes. Run `zend login` again |

## Log out

Delete `~/.zend/config.json`, and revoke the key from another session with [`zend keys revoke`](https://developers.usezend.app/cli/keys#revoke).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.