# Quick start

Get the LastPass API up and running in 5 minutes.

## Prerequisites

> The LastPass API is in early access. [Submit the opt-in form](https://info.lastpass.com/2026-API-Early-Access-Program.html) to request access. Wait for confirmation that the API is enabled for your account before creating an API key in the Admin Console. Other prerequisites:
>
> - A LastPass Business, Business Max, or MSP account
> - Access to the LastPass Admin Console
> - A terminal (macOS/Linux) or PowerShell (Windows)

```step
1
Get your API key
```

In the LastPass Admin Console, go to **Advanced → LastPass API** and generate a new API key. The key starts with `lpkey_`. For information on generating the API key in the Admin Console, see how to [manage LastPass API keys](https://link.lastpass.com/rest-api-reset-key).

Once the key is generated, set an environment variable by entering your key when prompted. The syntax depends on the environment:

**Linux and MacOS**:

```bash
# bash
read -r -s -p "New line for entering your API key: " LASTPASS_API_KEY
# or zsh
read -r -s "LASTPASS_API_KEY?New line for entering your API key: "
```

**Windows** (PowerShell):

```powershell
$env:LASTPASS_API_KEY = Read-Host "New line for entering your API key: "
```

Use the environment variable afterward when accessing the endpoints of LastPass API. Never hardcode or commit the API key in scripts or source control.

```step
2
Make your first API call
```

List all users in your organization with a `curl` command.

**Linux and MacOS**:

```bash
curl https://api.lastpass.com/business/v1/users \
  -H "Authorization: Api-Key $LASTPASS_API_KEY"
```

**Windows** (PowerShell):

```powershell
curl.exe https://api.lastpass.com/business/v1/users `
  -H "Authorization: Api-Key $env:LASTPASS_API_KEY"
```

The response looks like this:

```json
{
  "users": [
    { "id": "abc123", "email": "alice@example.com", "name": "Alice" },
    { "id": "def456", "email": "bob@example.com", "name": "Bob" }
  ],
  "nextPageToken": "MTY4NzM0NTYwMDAwMA=="
}
```
