# Pixelize public lead API

Public, unauthenticated JSON API for the Pixelize marketing site ([pixelize.com.br](https://pixelize.com.br)).

## Endpoints

| Method | Path | Auth | Purpose |
| --- | --- | --- | --- |
| `POST` | `/api/lead` | None | Submit a sales / consultation lead |
| `GET` | `/api/health` | None | Liveness check for the Worker |

OpenAPI: [`/openapi/lead.json`](https://pixelize.com.br/openapi/lead.json)  
API catalog: [`/.well-known/api-catalog`](https://pixelize.com.br/.well-known/api-catalog)  
Auth policy: [`/auth.md`](https://pixelize.com.br/auth.md)

## POST `/api/lead`

### Headers

- `Content-Type: application/json` (required)
- `Accept: application/json` (recommended)

### Body (JSON)

At minimum send `name` (2+ characters) and either `email` or `phone`.

| Field | Required | Notes |
| --- | --- | --- |
| `name` | yes | Contact name |
| `email` | one of email/phone | Valid email |
| `phone` | one of email/phone | E.164 preferred (`+5511…`) |
| `intent` | no | e.g. `consult`, `contact` |
| `company` | no | |
| `service` / `serviceLabel` | no | Service of interest |
| `message` | no | Free text |
| `locale` | no | `pt`, `en`, or `es` |
| `formId` | no | Caller / form identifier |
| `website` | no | **Honeypot — leave empty** |
| `attribution` | no | UTM / referrer object |

### Example

```bash
curl -sS -X POST 'https://pixelize.com.br/api/lead' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "intent": "consult",
    "name": "Jane Doe",
    "email": "jane@example.com",
    "phone": "+5511912345678",
    "serviceLabel": "WordPress",
    "message": "Preciso de um site institucional.",
    "locale": "pt",
    "formId": "agent",
    "website": ""
  }'
```

Success: `{"ok":true}`

### Errors

| Status | `error` | Meaning |
| --- | --- | --- |
| 400 | `name_required` / `contact_required` / `email_invalid` / `invalid_json` | Validation |
| 415 | `unsupported_media_type` | Missing JSON content type |
| 502 | `email_failed` | Email provider failure |
| 503 | `email_not_configured` | Server missing Resend secrets |

## GET `/api/health`

```bash
curl -sS 'https://pixelize.com.br/api/health'
```

Success: `{"ok":true,"service":"pixelize"}`

## Human pages

- Free consult form: https://pixelize.com.br/consultoria-gratuita
- Contact: https://pixelize.com.br/contato
- Services: https://pixelize.com.br/servicos
- LLM overview: https://pixelize.com.br/llms.txt
