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

# Quickstart

> Submit your first lead in under 5 minutes.

## Prerequisites

* A **publisher\_id** and **API Key** — provided by Leadhub.
* A **product\_id** for the product you want to submit leads for.

## Step 1 — Submit a lead

```bash theme={null}
curl -X POST https://{tenant}.techea.eu/api/v1/lead \
  -H "apikey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": "36068625-4707-4ef8-a419-2aad1483db49",
    "publisher_id": "b96bdbc6-437a-4e2f-9b0e-2d91a5767f3b",
    "customer": {
      "personal_data": {
        "first_name": "John",
        "last_name": "Smith",
        "birthday": "1988-05-10",
        "identification_number": "12345678A"
      },
      "contact": {
        "email": { "address": "john.smith@email.com" },
        "phone": { "area_code": "+34", "number": "600111222" }
      }
    },
    "product_data": {
      "loan_amount": 10000,
      "loan_purpose": "home_improvement",
      "loan_term_months": 36
    },
    "consents": {
      "entries": [
        { "type": "terms", "accepted": true, "accepted_at": "2026-02-16T10:22:31Z", "version": "v3.2", "document_url": "https://publisher.com/legal/terms/v3.2" },
        { "type": "privacy_policy", "accepted": true, "accepted_at": "2026-02-16T10:22:31Z", "version": "v4.1", "document_url": "https://publisher.com/legal/privacy/v4.1" }
      ],
      "metadata": {
        "ip_address": "84.23.12.55",
        "collected_at": "2026-02-16T10:22:31Z"
      }
    },
    "tracking": {
      "source": "https://www.example.com"
    }
  }'
```

## Step 2 — Handle the response

<CodeGroup>
  ```json New theme={null}
  {
    "lead_id": "a1b2c3d4-0000-0000-0000-111122223333",
    "status": "new"
  }
  ```

  ```json Distributed theme={null}
  {
    "lead_id": "a1b2c3d4-0000-0000-0000-111122223333",
    "status": "distributed",
    "redirect_url": "https://advertiser.example.com/apply?token=xyz123"
  }
  ```

  ```json Rejected theme={null}
  {
    "status": "rejected",
    "rejection_reason": "customer_already_exists"
  }
  ```
</CodeGroup>

| `status`      | What to do                                               |
| ------------- | -------------------------------------------------------- |
| `new`         | Lead accepted — no advertiser match yet, do not redirect |
| `distributed` | Redirect the customer to `redirect_url`                  |
| `rejected`    | Do not redirect — check `rejection_reason`               |

<Tip>
  Store the `lead_id` from the response. You'll need it to match incoming advertiser events to your own records.
</Tip>

## Step 3 — Receive advertiser events (optional)

When a customer converts with an advertiser, Leadhub will notify your configured callback URL:

```
GET {your_callback_url}?lead_id={lead_id}&event=loan_issued
```

Configure your callback URL with your Leadhub account manager.
