# Getting Started

## 1. Get credentials

You authenticate with **either** an API key **or** an OAuth2 client. Both are
created in the LedgerBee app under **Marketplace** — the **API Keys** and
**OAuth Clients** tabs. See **[Authentication](/guides/authentication)** for the
trade-offs.

## 2. Make your first call

With an API key:

```bash
curl https://api.ledgerbee.com/api/v1/company \
  -H "x-api-key: YOUR_API_KEY"
```

With an OAuth2 bearer token:

```bash
curl https://api.ledgerbee.com/api/v1/company \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

## 3. Explore interactively

Open the **[API Reference](/api)** and use the **Try it** console — paste your
key or token once and call any endpoint directly from the browser.

## Conventions

- **Pagination:** paginated list endpoints take `page` and `limit` query
  parameters (e.g. journal entries, invoices); response shapes are documented
  per endpoint in the **[API Reference](/api)**.
- **Idempotency:** usage reporting **requires** an `x-api-idempotency-key`
  header; other endpoints rely on natural keys or none — see
  **[Idempotency](/guides/idempotency)**.
- **Errors:** failures return a JSON body with a stable `code` plus details.
