# Leeeds developer docs

> How to send leads to Leeeds: the embed script, the WordPress plugin, and the HTTP API for server-side capture and lead retrieval.

Every integration posts to a site (a hostname) that Bruce & Eddy has registered in the Leeeds dashboard. Unregistered hostnames get `404`. Base URL: `https://leeeds.dev`.

## Embed script

Add `data-leeeds` to any form and load the script. Leeeds captures name, email, phone, and message, plus every other named field as an extra field labeled from its `<label>`. A form without an `action` is submitted inline and shows its result in a `[data-leeeds-status]` element marked `data-leeeds-state="success"` or `"error"`.

```html
<form data-leeeds>
  <input type="text" name="name" required>
  <input type="email" name="email" required>
  <input type="tel" name="phone">
  <textarea name="message"></textarea>
  <button type="submit">Send</button>
</form>
<script src="https://leeeds.dev/embed.js"></script>
```

## WordPress plugin

The Leeeds WordPress plugin adds a `[leeeds_form]` shortcode and a Gutenberg block, with settings under Settings → Leeeds. Version 1.1.0 and later support Turnstile.

## Server-side capture

Post JSON to `POST /api/leads` with the client API token as a bearer token. Tokens start with `lds_`, are shown once in the dashboard, and must stay on your server.

```bash
curl -X POST "https://leeeds.dev/api/leads" \
  -H "Authorization: Bearer lds_your_token" \
  -H "Content-Type: application/json" \
  -d '{"domain":"yourdomain.com","name":"Jane Doe","email":"jane@example.com","message":"Hello","fields":[{"name":"budget","label":"Budget","value":"10k"}]}'
```

- `201` stored.
- `401` missing, malformed, or revoked token.
- `403` the domain belongs to a different client.
- `404` the domain is not registered.
- `429` rate limited: 10 submissions per minute per domain.

## Retrieve leads

`GET /api/leads` with the same bearer token returns the 100 most recent leads for the client that owns it, as `{"leads": [...]}` with id, name, email, phone, message, domain, status, and created_at (Unix seconds).

## Limits

Name 200 characters, email 320, phone 50, message 5,000, page URL 2,000. At most one auto-reply per email address per site per 24 hours.

## Related

- [llms.txt](https://leeeds.dev/llms.txt): a machine-readable summary of Leeeds and when to use it.
- [Contact](https://leeeds.dev/contact) to get a site registered or a token issued.
