> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lancer-erp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create an API key, send a lead and read it back.

**1. Create an API key**

In Lancer, open **Settings → API and webhooks** ("הגדרות" → "API ו-Webhooks") and click **New key**. Give it a name (for example `Website form`) and tick only the scopes the integration needs. For this quickstart tick `leads:write` and `clients:read`.

> [!WARNING]
>
> The full key (`lk_…`) is shown **once**. Copy it into your secret manager before closing the dialog.

**2. Send a lead**

```bash cURL theme={null}
curl -X POST https://api.lancer-erp.com/api/v1/leads \
  -H "Authorization: Bearer $LANCER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Dana Levi",
    "company": "Echo Studio",
    "email": "dana@example.com",
    "phone": "050-1234567",
    "source": "website",
    "expectedValueAgorot": 1500000
  }'
```

```javascript Node.js theme={null}
const res = await fetch('https://api.lancer-erp.com/api/v1/leads', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.LANCER_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Dana Levi',
    company: 'Echo Studio',
    email: 'dana@example.com',
    phone: '050-1234567',
    source: 'website',
    expectedValueAgorot: 1_500_000, // ₪15,000
  }),
});
if (!res.ok) throw new Error(`Lancer ${res.status}: ${await res.text()}`);
const lead = await res.json();
console.log(lead.id);
```

```python Python theme={null}
import os, requests

res = requests.post(
    "https://api.lancer-erp.com/api/v1/leads",
    headers={"Authorization": f"Bearer {os.environ['LANCER_API_KEY']}"},
    json={
        "name": "Dana Levi",
        "company": "Echo Studio",
        "email": "dana@example.com",
        "phone": "050-1234567",
        "source": "website",
        "expectedValueAgorot": 1_500_000,  # ₪15,000
    },
    timeout=10,
)
res.raise_for_status()
print(res.json()["id"])
```

The API answers `201 Created` with the new lead. It lands in the first pipeline stage, unless you pass `stage` with the name of another stage.

**3. Read your clients**

```bash theme={null}
curl "https://api.lancer-erp.com/api/v1/clients?pageSize=10" \
  -H "Authorization: Bearer $LANCER_API_KEY"
```

```json Response theme={null}
{
  "items": [{ "id": "0193…", "name": "Echo Studio Ltd.", "type": "company", "email": "billing@echo.example", "…": "…" }],
  "total": 42,
  "page": 1,
  "pageSize": 10
}
```

**4. Get notified**

Add a webhook in the same settings page to receive `lead.created`, `payment.succeeded` and other events. See [Webhooks](https://docs.lancer-erp.com/guides/webhooks.md).

## Next steps

> [card] [Scopes](https://docs.lancer-erp.com/guides/authentication.md)
>
> Which scope each endpoint needs.

> [card] [Money in agorot](https://docs.lancer-erp.com/guides/pagination-and-money.md)
>
> How amounts and pages work.

> [card] [Full reference](https://docs.lancer-erp.com/api-reference/introduction.md)
>
> Try every endpoint in the browser.


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