# Preview enrichment

> Preview finding work emails or mobiles for leads (spends nothing)

`POST https://api.signalvan.com/v1/searches/{search_id}/enrich/preview`

Needs `leads:write` · Uses no credits · Idempotency-Key supported · 60 a minute · Web page: https://www.signalvan.com/developers/reference/preview-enrichment

**After step 8: preview a contact lookup.**

Works out a contact lookup for leads of a finished lead search exactly as the SignalVan app's
lookup sheet does: who it runs for (best lead score first, at most 1,000), who is skipped and why, what each person
needs, and the credits as a range with the live balance. `ready` is false with a `problem` when nothing can be looked
up or the credits are short (then `covers` says how many of the best people the credits cover).

Name the leads with `lead_keys`, or `group` (one group of the app's lead board: `ready`, `needs_email`, `partner`,
`look`, `aside`, `companies`), or neither for every lead. `want` is `email`, `phone` or `both`. For `companies` (the
companies with nobody named yet) the decision makers are found first, then their work emails.

Show the user `credits.sentence` and who is skipped; when they agree, start it with
`POST /searches/{search_id}/enrich` and the same body plus `confirm: true`.

**Credits:** none.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `search_id` | `string` | Yes | A lead search id (GET /searches) Example: `3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35`. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `website_id` | `string` | No | The website to act on (GET /websites). Left out: the key's default website, else its only one; a key that opens several websites and has no default must send it Example: `6f1c2b9e-4d3a-4b8e-9c21-7a5e0d3f8b14`. |

## Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Authorization` | `string` | Yes | Bearer and your API key. Keys are made in SignalVan: Account, API keys. Example: `Bearer sv_live_...`. |
| `Content-Type` | `string` | Yes | The body is JSON. Example: `application/json`. |
| `X-Website-Id` | `string` | No | The same as website_id, as a header (the query parameter wins when both are sent) Example: `6f1c2b9e-4d3a-4b8e-9c21-7a5e0d3f8b14`. |
| `Idempotency-Key` | `string` | No | Send the same key to retry safely: the first answer comes back (24 hours) Example: `plan-2026-11-20-leeds-01`. |

## Body (application/json)

- `lead_keys` (string[] | null): These leads (lead_key from the leads list), up to 1,000
- `group` (string | null): Or one group of the app's lead board: ready (good fit with a verified email), needs_email (good fit, email not found yet), partner, look (people to check), aside (set aside), companies (companies with nobody named yet: their decision makers are found first) One of: `ready`, `needs_email`, `partner`, `look`, `aside`, `companies`.
- `want` (string): Work emails, mobiles or both One of: `email`, `phone`, `both`.
- `limit` (integer | null): Keep only the best N people (by lead score)
- `max_credits` (integer | null): The most credits the lookup may use

## Response · 200 (application/json)

- `search_id` (string, required): The lead search
- `want` (string, required): What is looked up: work emails, mobiles or both One of: `email`, `phone`, `both`.
- `mode` (string, required): contacts: emails and mobiles of the people; decision_makers: the companies group, whose decision makers are found first One of: `contacts`, `decision_makers`.
- `people` (integer, required): People in the selection (best lead score first, at most 1,000)
- `matched` (integer, required): People the selection matched before the 1,000 cap and limit
- `qualifies` (integer, required): People something can be looked up for now
- `to_look_up` (integer, required): The same as qualifies
- `items` (EnrichmentItems, required): What the people need, per kind of detail
  - `profile` (object): Contact lookups: full profiles: need (none yet), done (already have one), tried (none was found last time)
  - `email` (object): Contact lookups: work emails: need (no email yet), now (can be looked up now), after_profile (once a profile brings the company website), cannot (nothing to look them up with)
  - `phone` (object): Contact lookups: mobiles: need (no mobile yet)
  - `people` (object): Finding decision makers (the companies group): site (a confirmed website, the person next), site_first (the website found first), cannot, has_person
- `skipped` (SkippedReason[], required): Everyone skipped, by reason
  - `reason` (string, required): Why nothing can be looked up for them yet
  - `count` (integer, required): How many people
- `skipped_people` (Skipped[], required): The people skipped, with why (up to 50)
  - `lead_key` (string, required): The lead's lead_key
  - `name` (string, required): The person or business
  - `why` (string, required): Why nothing can be looked up for them yet
- `skipped_total` (integer, required): How many people are skipped in all
- `credits` (EnrichmentCredits, required): The credits, before anything is used
  - `range` (CreditRange, required): The credits as a range, with one plain sentence
  - `likely` (integer | null, required): What it usually uses
  - `at_most` (integer | null, required): The most it may use
  - `keep_at_least` (integer | null, required): The credits the account needs available to start it
  - `sentence` (string, required): The estimate in one plain sentence: show it to the user
  - `miss_free` (boolean, required): true when a lookup that finds nothing uses no credits
  - `balance` (Credits, required): The live balance
- `covers` (integer | null, required): When the credits are short: how many of the best people they cover (send limit with this number to look up those)
- `ready` (boolean, required): true when it can start: someone to look up and enough credits
- `problem` (string | null, required): Why it cannot start yet, in plain words (null when ready)
- `next` (string, required): What to do next, in plain words
- `app_url` (string, required): The lead search in SignalVan

## Responses

- `200`: Who would be looked up, who is skipped and the credits
- `400` `invalid`: A field is not valid (the detail names it)
- `401` `unauthorized`: No API key, or the key is not valid
- `402`: Not enough credits, or above the limit (spending routes)
- `403` `scope_missing`: The key lacks the permission (scope_missing)
- `404` `not_found`: Not found, or not yours
- `409` `not_finished`: plan_expired, busy or idempotency_conflict (spending routes)
- `422`: needs_input: the plan still needs settings (spending routes)
- `429` `rate_limited`: Too many requests: wait Retry-After seconds
- `503` `unavailable`: Temporarily unavailable: retry with backoff

## Request

Every request below is complete and runs as copied (set SIGNALVAN_API_KEY first). website_id is needed when your key opens several websites; it takes the website's id or its domain.

### Work emails for every lead

cURL:

```bash
curl -X POST "https://api.signalvan.com/v1/searches/3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35/enrich/preview?website_id=6f1c2b9e-4d3a-4b8e-9c21-7a5e0d3f8b14" \
  -H "Authorization: Bearer $SIGNALVAN_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "want": "email"
  }'
```

Python:

```python
import os, uuid, requests

r = requests.post(
    "https://api.signalvan.com/v1/searches/3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35/enrich/preview?website_id=6f1c2b9e-4d3a-4b8e-9c21-7a5e0d3f8b14",
    headers={
        "Authorization": f"Bearer {os.environ['SIGNALVAN_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "want": "email"
    },
    timeout=70,
)
r.raise_for_status()
print(r.json())
```

Node.js:

```javascript
const r = await fetch("https://api.signalvan.com/v1/searches/3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35/enrich/preview?website_id=6f1c2b9e-4d3a-4b8e-9c21-7a5e0d3f8b14", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SIGNALVAN_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    "want": "email"
  }),
})
if (!r.ok) throw new Error((await r.json()).detail)
console.log(await r.json())
```

### Work emails and mobiles for chosen leads

cURL:

```bash
curl -X POST "https://api.signalvan.com/v1/searches/3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35/enrich/preview?website_id=6f1c2b9e-4d3a-4b8e-9c21-7a5e0d3f8b14" \
  -H "Authorization: Bearer $SIGNALVAN_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "lead_keys": [
      "l:sarah-whitfield-4a2b91",
      "l:mark-oduya-77c1e0"
    ],
    "want": "both"
  }'
```

Python:

```python
import os, uuid, requests

r = requests.post(
    "https://api.signalvan.com/v1/searches/3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35/enrich/preview?website_id=6f1c2b9e-4d3a-4b8e-9c21-7a5e0d3f8b14",
    headers={
        "Authorization": f"Bearer {os.environ['SIGNALVAN_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "lead_keys": ["l:sarah-whitfield-4a2b91", "l:mark-oduya-77c1e0"],
        "want": "both"
    },
    timeout=70,
)
r.raise_for_status()
print(r.json())
```

Node.js:

```javascript
const r = await fetch("https://api.signalvan.com/v1/searches/3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35/enrich/preview?website_id=6f1c2b9e-4d3a-4b8e-9c21-7a5e0d3f8b14", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SIGNALVAN_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    "lead_keys": [
      "l:sarah-whitfield-4a2b91",
      "l:mark-oduya-77c1e0"
    ],
    "want": "both"
  }),
})
if (!r.ok) throw new Error((await r.json()).detail)
console.log(await r.json())
```

### Every field: the best 25 good fits without an email yet, with a credit limit

cURL:

```bash
curl -X POST "https://api.signalvan.com/v1/searches/3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35/enrich/preview?website_id=6f1c2b9e-4d3a-4b8e-9c21-7a5e0d3f8b14" \
  -H "Authorization: Bearer $SIGNALVAN_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "group": "needs_email",
    "want": "email",
    "limit": 25,
    "max_credits": 400
  }'
```

Python:

```python
import os, uuid, requests

r = requests.post(
    "https://api.signalvan.com/v1/searches/3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35/enrich/preview?website_id=6f1c2b9e-4d3a-4b8e-9c21-7a5e0d3f8b14",
    headers={
        "Authorization": f"Bearer {os.environ['SIGNALVAN_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "group": "needs_email",
        "want": "email",
        "limit": 25,
        "max_credits": 400
    },
    timeout=70,
)
r.raise_for_status()
print(r.json())
```

Node.js:

```javascript
const r = await fetch("https://api.signalvan.com/v1/searches/3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35/enrich/preview?website_id=6f1c2b9e-4d3a-4b8e-9c21-7a5e0d3f8b14", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SIGNALVAN_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    "group": "needs_email",
    "want": "email",
    "limit": 25,
    "max_credits": 400
  }),
})
if (!r.ok) throw new Error((await r.json()).detail)
console.log(await r.json())
```

## Response example · 200

```json
{
  "search_id": "3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35",
  "want": "email",
  "mode": "contacts",
  "people": 31,
  "matched": 31,
  "qualifies": 27,
  "to_look_up": 27,
  "items": {
    "profile": {
      "need": 12,
      "done": 19,
      "tried": 0
    },
    "email": {
      "need": 29,
      "now": 27,
      "after_profile": 0,
      "cannot": 2
    },
    "phone": {
      "need": 31
    }
  },
  "skipped": [
    {
      "reason": "no company website to look on yet",
      "count": 2
    }
  ],
  "skipped_people": [
    {
      "lead_key": "l:mark-oduya-77c1e0",
      "name": "Mark Oduya",
      "why": "no company website to look on yet"
    }
  ],
  "skipped_total": 2,
  "credits": {
    "range": {
      "needs_at_least": null,
      "expected": 120,
      "at_most": 260,
      "sentence": "Usually uses about 120, stops at 260. You are charged for what it really uses, up to that limit."
    },
    "likely": 120,
    "at_most": 260,
    "keep_at_least": 300,
    "sentence": "About 120 credits, at most 260.",
    "miss_free": false,
    "balance": {
      "available": 2350,
      "balance": 2500,
      "held": 150,
      "low": false
    }
  },
  "covers": null,
  "ready": true,
  "problem": null,
  "next": "Show the user credits.sentence and who is skipped. When they agree, POST /v1/searches/3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35/enrich with the same body and confirm: true.",
  "app_url": "https://www.signalvan.com/studio?p=leads&view=job&job=3f6d2a8e-9b1c-4e57-8a20-6c4b1d9e7f35"
}
```
