# API Reference

> One page of the LogDuck documentation. Every page is listed in https://logduck.com/llms.txt, and https://logduck.com/llms-full.txt is all of them in one file.

The LogDuck API is a REST API that accepts JSON requests and returns JSON responses.

## Base URL

```text
https://api.logduck.com
```

## Endpoints

**`POST /v1/events`** - Send a new event

## Required Headers

`X-API-Key` — Your project API key for authentication.

`Idempotency-Key` — A unique string (16–36 characters, alphanumeric, hyphens, or underscores). Can be any string as long as it is unique between requests — UUID4 and ULID are good options. Enables safe retries by deduplicating requests with the same key.

## Response Codes

`200` - Success

`400` - Bad Request (invalid payload)

`401` - Unauthorized (invalid or missing API key)

`429` - Rate Limited

Two separate limits return a 429. Ingestion is capped at **1,000 events per API key per minute** in a fixed window, which resets at the top of each minute — a burst that exceeds it is rejected rather than queued. Separately, exhausting your plan's monthly event allowance rejects further events until the limit resets on your billing cycle. Both are safe to retry with the same `Idempotency-Key`; the official SDKs retry a 429 once, honouring `Retry-After`.

> **Note: Monthly Event Limits**
> Event limits are based on your subscription plan. The **Free** tier includes 1,000 events per month. The **Pro** tier includes 100,000 events per month per project. Limits reset on your billing cycle.
