# Score a list

> Score up to 1,000 domains, emails or LinkedIn URLs in one call. Same prices per input; one score per company.

`POST https://mmkuffhlzytnmgraagbp.supabase.co/functions/v1/score/{domain|email|social}/bulk`

Add `/bulk` to any scoring path to send a list. Each input is handled and priced exactly as on its single page ([domain](/score-domain), [email](/score-email), [LinkedIn](/score-social)).

## Start

```bash
curl -X POST "https://mmkuffhlzytnmgraagbp.supabase.co/functions/v1/score/domain/bulk" \
  -H "Authorization: Bearer $PLATINUX_API_KEY" -H "Content-Type: application/json" \
  -d '{"template_id": "4d286e65-…", "inputs": ["notion.so", "https://www.notion.so/pricing", "linear.app", "logo.png"]}'
```

| Body field | Type | Required | Notes |
|---|---|---|---|
| `template_id` | string (UUID) | Yes | Your live template |
| `inputs` | array of strings | Yes | 1 to 1,000. Also accepted as `domains`, `emails` or `urls` |

### Started: `202`

```json
{ "batch_id": "a3a4f2e6-…", "accepted": 3, "rejected": [ { "input": "logo.png", "reason": "file_name" } ], "check_after_seconds": 30 }
```

Invalid inputs are listed in `rejected` (free); the rest run. Credits for the most the list can cost are checked **up front** (`402` if short); you pay only for what is scored.

## Check

```bash
curl "https://mmkuffhlzytnmgraagbp.supabase.co/functions/v1/score/domain/bulk?batch_id=a3a4f2e6-…&page=1" -H "Authorization: Bearer $PLATINUX_API_KEY"
```

`202` while running, `200` when complete; 100 results per page. **Keep checking:** each check also moves the list forward.

```json
{ "batch_id": "a3a4f2e6-…", "status": "complete", "total": 3, "finished": 3, "processing": 0, "credits_charged": 20,
  "results": [
    { "input": "notion.so", "input_type": "domain", "domain": "notion.so", "status": "complete", "score": 48, "scored_at": "…", "credits_charged": 10 },
    { "input": "https://www.notion.so/pricing", "input_type": "domain", "domain": "notion.so", "status": "complete", "score": 48, "scored_at": "…", "credits_charged": 0 },
    { "input": "linear.app", "input_type": "domain", "domain": "linear.app", "status": "complete", "score": 48, "scored_at": "…", "credits_charged": 10 } ],
  "page": 1, "pages": 1 }
```

**One score per company:** inputs that lead to the same company share one score, charged once.

## Result status

| `status` | Meaning | Charged |
|---|---|---|
| `processing` | Still working | |
| `complete` / `partial` | Scored (`partial`: some data didn't arrive in time) | The input's price, once per company |
| `not_found` | No company found (email or LinkedIn) | No |
| `temporary_email` | A disposable email | No |
| `rejected` | The company's website failed the [Domain checks](/domain-checks); `reason` says why | No |
| `insufficient_credits` | Ran out of credits | No |
| `failed` | A data source kept failing | No |

## Good to know

- **One list at a time per account** (shared with every bulk scoring endpoint): `409 batch_in_progress`.
- **Timing:** domains and work emails go at the speed of scoring (usually a few minutes); generic emails and LinkedIn URLs add a few seconds each to find the company.

## Errors

| HTTP | `error` | When |
|---|---|---|
| 400 | `invalid_input` | Missing `template_id` / `inputs`, or nothing valid (`reason: none_valid`) |
| 400 | `too_many_inputs` | More than 1,000 |
| 401 | `unauthorized` | Missing, wrong or revoked key |
| 402 | `insufficient_credits` | Balance below the most the list can cost |
| 404 | `batch_not_found` | Wrong `batch_id` |
| 409 | `batch_in_progress` | A scoring list is already running |
| 409 / 422 | `template_not_live` / `template_empty` | Template problems |
