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

# Lead Postback API

> Server-to-server lead submission via POST JSON API

## Endpoints

| Method | Endpoint | Use Case |
| - | - | - |
| `POST` | `/lead/postback` | Full lead data including PII |
| `GET` | `/lead/postback` | TID + sub-fields only (no PII) |

## POST Request

| Field | Type | Required | Description |
| - | - | - | - |
| `tid` | `string` | ✅ | Click tracking ID (or use `click_id` — same thing) |
| `name` | `string` | ✅ | Lead's full name |
| `phone` | `string` | ✅ | Phone number |
| `email` | `string` | ❌ | Email address |
| `address` | `string` | ❌ | Street address |
| `pincode` | `string` | ❌ | Postal code / pincode |
| `city` | `string` | ❌ | City |
| `state` | `string` | ❌ | State or province |
| `sub1-sub5` | `string` | ❌ | Custom sub-parameters |
| `payout` | `string` | ❌ | Payout override |
| `currency` | `string` | ❌ | Currency code (default: USD) |

<Note>`name` and `phone` are required. All other fields are optional.</Note>

## Copy-Paste Example

Replace `tid` and `X-API-Key` with your own values and run it:

```bash theme={null}
curl -X POST https://track.adscrush.com/lead/postback \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <YOUR_API_KEY>" \
  -d '{"tid": "550e8400-e29b-41d4-a716-446655440000", "name": "John", "phone": "+1234567890", "email": "john@example.com", "address": "221B Baker Street", "pincode": "400001", "city": "Mumbai", "state": "Maharashtra"}'
```

### PHP (cURL)

Replace `tid` and `X-API-Key` with your own values:

```php theme={null}
<?php

$data = [
  'tid'     => '550e8400-e29b-41d4-a716-446655440000',
  'name'    => 'John',
  'phone'   => '+1234567890',
  'email'   => 'john@example.com',
  'address' => '221B Baker Street',
  'pincode' => '400001',
  'city'    => 'Mumbai',
  'state'   => 'Maharashtra',
];

$ch = curl_init('https://track.adscrush.com/lead/postback');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST           => true,
  CURLOPT_HTTPHEADER     => [
    'Content-Type: application/json',
    'X-API-Key: <YOUR_API_KEY>',
  ],
  CURLOPT_POSTFIELDS     => json_encode($data),
]);

$response = curl_exec($ch);
$status   = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($status === 200) {
  $result = json_decode($response, true);
  echo "Lead tracked: {$result['leadId']}\n";
} else {
  echo "Error ({$status}): $response\n";
}
```

**Using a different click ID parameter?** Both `tid` and `click_id` are accepted — `tid` is used when both are present.

## Response

```json theme={null}
{ "success": true, "leadId": "lead_abc123", "isDuplicate": false }
```

## Deduplication

One lead per click is enforced. Duplicate submissions return `isDuplicate: true` with the existing `leadId`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.