# Contact enrichment

> Find work emails and phone numbers for people, or domains, phones and LinkedIn pages for companies, a few at a time or in large batches.

- Human-readable page: https://dashboard.sproutsdata.ai/docs/guides/enrichment
- This document: https://dashboard.sproutsdata.ai/docs/agents/guides/enrichment
- Index of every agent document: https://dashboard.sproutsdata.ai/llms.txt
- API base URL: https://api.sproutsdata.ai

## Summary

Enrichment finds contact values for identified records: `EMAIL`/`PHONE` for people (`entity: "contacts"`), `DOMAIN`/`PHONE`/`LINKEDIN_URL` for companies (`entity: "accounts"`). Two routes take the same body: a synchronous lookup (`POST /v1/enrichment/lookups`, at most 20 items) and an asynchronous job (`POST /v1/enrichment/jobs`, at most 10,000 items). Charged per value newly found.

## Rules

- Scopes: lookups, job start and cancel need `dsp.enrichment.write`. Job read, list and results need `dsp.enrichment.read` or `dsp.enrichment.write`.
- Body (both routes): `fields` (required, 1 to 3 distinct values, no default), `items` (required, min 1; lookup max 20; job max 10,000), `entity` (`contacts` default, or `accounts`), `re_enrich` (bool, default false), `verify_mode` (`skip` | `moderate` | `strict`; contacts only; unset = workspace setting). Lookup only: `wait_seconds` (0 to 20; unset = API default, kept within the request deadline). Job only: `name` (max 120 chars).
- Allowed fields: `contacts` → `EMAIL`, `PHONE`. `accounts` → `DOMAIN`, `PHONE`, `LINKEDIN_URL`. Anything else: 422.
- Item fields (all optional strings): `linkedin_url` (max 2,048), `company_domain`, `company_name`, `first_name`, `last_name`, `full_name`, `email_hint`, `person_id` (our person id; legacy alias `es_id`), `company_id` (our company id), `external_id` (your id, echoed; legacy alias `reference`), `fields` (subset of the request's `fields`). Person-only fields (`first_name`, `last_name`, `full_name`, `email_hint`, `person_id`, `es_id`) are refused for `accounts`; `company_id` is refused for `contacts` (422). Unknown keys: 422.
- Identify contacts by `linkedin_url` or `person_id` (repeats are free), or by a name plus `company_domain`/`company_name` (looked up and charged each time). Identify accounts by `company_domain`, `company_name`, the company LinkedIn page as `linkedin_url`, or `company_id`.
- Default prices per value newly found, in credits: `EMAIL` 1, `PHONE` 9, `DOMAIN` 1, `LINKEDIN_URL` 1. A miss is free. With `re_enrich: false`, a value already found for the same LinkedIn profile or record is returned free; with `re_enrich: true` it is looked up and charged again.
- Billing: the maximum (every field of every item at its price) is HELD before anything is looked up; 402 `credits.insufficient` if not covered (nothing looked up). At the end only values found are charged; the rest is released. One request may hold at most 30,000 credits; above that: 422 (split it or ask fewer fields). Estimate: `POST /v1/credits/quote` with `{"operation": "enrichment", "rows": N, "fields": [...]}`.
- Lookup answer (200): `job_id`, `status`, `complete`, `results`, `values_found`, `credits_used`, `suppressed_rows`, `reason`, `meta`. `complete: false` = did not finish within the wait; the remainder continues as job `job_id` (read it with the job routes; it settles when it ends). Rows still running list fields in `incomplete`.
- Lookup `Idempotency-Key`: optional, max 255 chars; same key returns the first answer, charged once.
- Job `Idempotency-Key`: REQUIRED, max 255 chars. Missing: 400 `request.invalid`. Same key + same body: returns the first job with `reused: true`. Same key + different body: 409 `enrichment.idempotency_key_reused`.
- Job start answer (202): `job_id`, `entity`, `status`, `total_rows`, `reused`, `suppressed_rows`, `meta`.
- Job statuses: `queued`, `running`, `cancelling`, `completed`, `failed`, `cancelled`. Final: `completed`, `failed`, `cancelled`.
- Job read `GET /v1/enrichment/jobs/{job_id}`: `status`, `counts` (`total_rows`, `done_rows`, `rows`, `field_counts`), `credits_used` (so far), `credits_charged` (null until ended), `values_found` (null until ended), `eta_seconds`, `rows_per_second`, `stop_reason`, `suppressed_rows`, `error`, timestamps. Reading an ended job settles it.
- `stop_reason`: `time_limit` (still running 6 hours after start) or `no_credits` (workspace could no longer cover it). Values found until then are charged.
- Job results `GET /v1/enrichment/jobs/{job_id}/results?limit=&cursor=`: `limit` 1 to 500, default 100; `cursor` max 512 chars. Rows in request order, readable while the job runs. Kept 7 days after the job ends; then 410 `enrichment.results_expired`.
- Job list `GET /v1/enrichment/jobs?status=&limit=&cursor=`: newest first; `limit` 1 to 100, default 20.
- Cancel `POST /v1/enrichment/jobs/{job_id}/cancel`: idempotent; only values already found are charged.
- Row: `idx` (position in your `items`, from 0), `input`, `outcome` (`found`, `partial`, `not_found`, `error`, `cancelled`, `skipped`, `suppressed`), `fields` (per field: `status` `found`|`not_found`|`error`|`cancelled`|`skipped`|`suppressed`, `value`, `verified`, `reason` `no_source`|`sources_unavailable`|`not_found`|`not_enough_input`|`error`), `values_found`, `credits`, `incomplete`.
- Do-Not-Contact: listed people (contacts) or companies (accounts) are removed before lookup, never charged; their positions are in `suppressed_rows`, and they read `outcome: "suppressed"` with blanked fields. Rows listed after enrichment also read `suppressed`. If every item is listed: 422 `request.invalid`.
- `job_id` pattern: `^[0-9a-fA-F-]{32,36}$`.

## Steps

1. Up to 20 records and an answer now: `POST /v1/enrichment/lookups`. If `complete` is false, continue with step 3 using `job_id`.
2. More records: `POST /v1/enrichment/jobs` with `Idempotency-Key`.
3. Poll `GET /v1/enrichment/jobs/{job_id}` until `status` is final.
4. Page `GET /v1/enrichment/jobs/{job_id}/results` within 7 days of the end.

## Examples

```json
{
  "fields": ["EMAIL"],
  "items": [{ "linkedin_url": "https://www.linkedin.com/in/jane-doe-example" }]
}
```

```json
{
  "name": "Q4 prospects",
  "fields": ["EMAIL", "PHONE"],
  "items": [
    { "linkedin_url": "https://www.linkedin.com/in/jane-doe-example" },
    { "full_name": "Alex Example", "company_domain": "stripe.com" }
  ]
}
```

## Operations

### POST /v1/enrichment/lookups

Enrich a few records in one call

- URL: `POST https://api.sproutsdata.ai/v1/enrichment/lookups`
- Scopes (any one): `dsp.enrichment.write`
- Cost: billed: an answer with results spends credits, an empty one is free
- Idempotency-Key header: optional

At most 20 records, answered in the call. The most it can cost is held first (402
before anything is looked up); only values newly found are charged. Send an
`Idempotency-Key` to retry safely: the same key answers the first lookup again and is
not charged twice. A lookup that does not finish in the call becomes a job
(`complete: false`).

Headers:

- `Idempotency-Key` (string): Send one to make a retry safe: a retry with the same key on the same UTC day is charged once.

Request body (JSON, required):

- `fields` (array of string, required): What to find. No default: nothing is looked up, or charged, that you did not ask for. One of: `"EMAIL"`, `"PHONE"`, `"DOMAIN"`, `"LINKEDIN_URL"`. Limits: 1 to 3 items.
- `items` (array of object, required): Limits: 1 to 20 items.
  - `company_domain` (string or null): Limits: at most 512 characters.
  - `company_id` (string or null): Our id for a company. Limits: at most 512 characters.
  - `company_name` (string or null): Limits: at most 512 characters.
  - `email_hint` (string or null): Limits: at most 512 characters.
  - `es_id` (string or null): Legacy name of person_id. Limits: at most 512 characters.
  - `external_id` (string or null): Your id, echoed. Limits: at most 512 characters.
  - `fields` (array of string or null): This row's own fields, a subset of the request's. Unset: all of them. One of: `"EMAIL"`, `"PHONE"`, `"DOMAIN"`, `"LINKEDIN_URL"`. Limits: at least 1 items.
  - `first_name` (string or null): Limits: at most 512 characters.
  - `full_name` (string or null): Limits: at most 512 characters.
  - `last_name` (string or null): Limits: at most 512 characters.
  - `linkedin_url` (string or null): Limits: at most 2048 characters.
  - `person_id` (string or null): Our id for a person. Limits: at most 512 characters.
  - `reference` (string or null): Legacy: external_id. Limits: at most 512 characters.
- `entity` (string): One of: `"contacts"`, `"accounts"`. Default `"contacts"`.
- `re_enrich` (boolean): Look up values that are already known. Off (the default), a value already found for the same LinkedIn profile or Sprouts record comes back at no charge. Rows sent with only a name and company are looked up, and charged, each time: send `linkedin_url` or `person_id` to get repeats free. Default `false`.
- `verify_mode` (string or null): Contacts only. How emails are verified: `skip` (not at all), `moderate` (syntax, domain and the source's own signal) or `strict` (every email checked by a verifier). Unset: the workspace's setting. One of: `"skip"`, `"moderate"`, `"strict"`.
- `wait_seconds` (number or null): Limits: 0 to 20.

Response 200 (application/json): Successful Response
Response fields:

- `complete` (boolean, required): False when the lookup did not finish in the call: it became the job `job_id`, which settles its credits when it ends; read it for the rest.
- `credits_used` (number, required)
- `job_id` (string, required)
- `meta` (object, required)
  - `as_of` (string (date-time), required)
  - `request_id` (string, required)
  - `credential` (string): One of: `"api_key"`, `"session"`. Default `"api_key"`.
  - `credits_balance` (number or null): What the workspace has available after this request, in credits (credits held for running agent runs excluded). `null` when not metered or not known just now; `GET /v1/credits` always has it.
  - `credits_charged` (number or null): What this request cost, in credits. `null` when not metered.
  - `environment` (string): Deprecated: always `live` (there are no test keys). Will be removed. One of: `"live"`. Default `"live"`.
- `results` (array of object, required)
  - `credits` (number, required): Credits this row used: each value newly found at its field's price (a phone number costs more than an email).
  - `fields` (map of object, required)
  - `idx` (integer, required): The row's position in the job, from 0.
  - `input` (object, required): The row as you sent it.
  - `outcome` (string, required): `found`, `partial`, `not_found`, `error`, `cancelled`, `skipped` or `suppressed` (on the Do-Not-Contact list: never looked up, or blanked since).
  - `values_found` (integer, required): Values newly found for this row (what `credits` prices): 0 for a miss, a value already known, or a row on the Do-Not-Contact list.
  - `incomplete` (array of string or null): Fields a lookup's deadline cut: still being looked up.
- `status` (string, required): One of: `"queued"`, `"running"`, `"cancelling"`, `"completed"`, `"failed"`, `"cancelled"`.
- `values_found` (integer, required): Values newly found and charged for, one each whatever the field; rows on the Do-Not-Contact list are left out. For a lookup cut by its deadline: those found in the call.
- `reason` (string or null)
- `suppressed_rows` (array of integer): Positions in `items` left out because they are on the Do-Not-Contact list: never looked up, never charged.

Errors:

- 401: No credential, or one that does not verify (`auth.unauthorized`).
- 402: Not enough credits (`credits.insufficient`).
- 403: The credential lacks the scope this route needs (`auth.insufficient_scope`), or the signed-in user has not chosen a workspace (`auth.workspace_required`).
- 413: More rows than one lookup takes (`request.too_large`): start a job.
- 422: The request is invalid (`request.invalid`), or its cursor is (`pagination.*`).
- 429: Too many requests for this key or workspace (`quota.burst_exceeded`). See `Retry-After`.
- 503: A service this request needs is unavailable, or the API is at capacity. See `Retry-After`.
- 504: The request did not finish within its time budget (`upstream.timeout`).

Example request:

```bash
curl -X POST "https://api.sproutsdata.ai/v1/enrichment/lookups" \
  -H "X-API-Key: $SPROUTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "fields": [
         "EMAIL"
       ],
       "items": [
         {
           "linkedin_url": "https://www.linkedin.com/in/jane-doe-example"
         }
       ]
     }'
```

### POST /v1/enrichment/jobs

Start an enrichment job

- URL: `POST https://api.sproutsdata.ai/v1/enrichment/jobs`
- Scopes (any one): `dsp.enrichment.write`
- Cost: billed: an answer with results spends credits, an empty one is free
- Idempotency-Key header: required

Start a job and get its handle at once (202). The most it can cost (every field of
every row found, each at its price in the price list) is held first; only values newly
found are charged when it ends.

Headers:

- `Idempotency-Key` (string, required): One value per intended request, reused on a retry: the retry returns the first answer instead of doing (and charging for) the work twice. Required here.

Request body (JSON, required):

- `fields` (array of string, required): What to find. No default: nothing is looked up, or charged, that you did not ask for. One of: `"EMAIL"`, `"PHONE"`, `"DOMAIN"`, `"LINKEDIN_URL"`. Limits: 1 to 3 items.
- `items` (array of object, required): Limits: at least 1 items.
  - `company_domain` (string or null): Limits: at most 512 characters.
  - `company_id` (string or null): Our id for a company. Limits: at most 512 characters.
  - `company_name` (string or null): Limits: at most 512 characters.
  - `email_hint` (string or null): Limits: at most 512 characters.
  - `es_id` (string or null): Legacy name of person_id. Limits: at most 512 characters.
  - `external_id` (string or null): Your id, echoed. Limits: at most 512 characters.
  - `fields` (array of string or null): This row's own fields, a subset of the request's. Unset: all of them. One of: `"EMAIL"`, `"PHONE"`, `"DOMAIN"`, `"LINKEDIN_URL"`. Limits: at least 1 items.
  - `first_name` (string or null): Limits: at most 512 characters.
  - `full_name` (string or null): Limits: at most 512 characters.
  - `last_name` (string or null): Limits: at most 512 characters.
  - `linkedin_url` (string or null): Limits: at most 2048 characters.
  - `person_id` (string or null): Our id for a person. Limits: at most 512 characters.
  - `reference` (string or null): Legacy: external_id. Limits: at most 512 characters.
- `entity` (string): One of: `"contacts"`, `"accounts"`. Default `"contacts"`.
- `name` (string or null): A label for your list. Limits: at most 120 characters.
- `re_enrich` (boolean): Look up values that are already known. Off (the default), a value already found for the same LinkedIn profile or Sprouts record comes back at no charge. Rows sent with only a name and company are looked up, and charged, each time: send `linkedin_url` or `person_id` to get repeats free. Default `false`.
- `verify_mode` (string or null): Contacts only. How emails are verified: `skip` (not at all), `moderate` (syntax, domain and the source's own signal) or `strict` (every email checked by a verifier). Unset: the workspace's setting. One of: `"skip"`, `"moderate"`, `"strict"`.

Response 202 (application/json): Successful Response
Response fields:

- `entity` (string, required): One of: `"contacts"`, `"accounts"`.
- `job_id` (string, required)
- `meta` (object, required)
  - `as_of` (string (date-time), required)
  - `request_id` (string, required)
  - `credential` (string): One of: `"api_key"`, `"session"`. Default `"api_key"`.
  - `credits_balance` (number or null): What the workspace has available after this request, in credits (credits held for running agent runs excluded). `null` when not metered or not known just now; `GET /v1/credits` always has it.
  - `credits_charged` (number or null): What this request cost, in credits. `null` when not metered.
  - `environment` (string): Deprecated: always `live` (there are no test keys). Will be removed. One of: `"live"`. Default `"live"`.
- `reused` (boolean, required): True when this `Idempotency-Key` had started this job.
- `status` (string, required): One of: `"queued"`, `"running"`, `"cancelling"`, `"completed"`, `"failed"`, `"cancelled"`.
- `total_rows` (integer, required)
- `suppressed_rows` (array of integer): Positions in `items` left out because they are on the Do-Not-Contact list: never looked up, never charged.

Errors:

- 400: A required header is missing or unusable (`request.invalid`).
- 401: No credential, or one that does not verify (`auth.unauthorized`).
- 402: Not enough credits (`credits.insufficient`).
- 403: The credential lacks the scope this route needs (`auth.insufficient_scope`), or the signed-in user has not chosen a workspace (`auth.workspace_required`).
- 409: This `Idempotency-Key` started another job (`enrichment.idempotency_key_reused`).
- 422: The request is invalid (`request.invalid`), or its cursor is (`pagination.*`).
- 503: A service this request needs is unavailable, or the API is at capacity. See `Retry-After`.
- 504: The request did not finish within its time budget (`upstream.timeout`).

Example request:

```bash
curl -X POST "https://api.sproutsdata.ai/v1/enrichment/jobs" \
  -H "X-API-Key: $SPROUTS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
       "name": "Q4 prospects",
       "fields": [
         "EMAIL",
         "PHONE"
       ],
       "items": [
         {
           "linkedin_url": "https://www.linkedin.com/in/jane-doe-example"
         },
         {
           "full_name": "Alex Example",
           "company_domain": "example.com"
         }
       ]
     }'
```

### GET /v1/enrichment/jobs

List the workspace's jobs

- URL: `GET https://api.sproutsdata.ai/v1/enrichment/jobs`
- Scopes (any one): `dsp.enrichment.read`, `dsp.enrichment.write`
- Cost: free

The workspace's jobs, newest first, with the status each had when last read.

Query parameters:

- `status` (string or null): One of: `"queued"`, `"running"`, `"cancelling"`, `"completed"`, `"failed"`, `"cancelled"`.
- `cursor` (string or null): Limits: at most 512 characters.
- `limit` (integer): Default `20`. Limits: 1 to 100.

Response 200 (application/json): Successful Response
Response fields:

- `has_more` (boolean, required)
- `meta` (object, required)
  - `as_of` (string (date-time), required)
  - `request_id` (string, required)
  - `credential` (string): One of: `"api_key"`, `"session"`. Default `"api_key"`.
  - `credits_balance` (number or null): What the workspace has available after this request, in credits (credits held for running agent runs excluded). `null` when not metered or not known just now; `GET /v1/credits` always has it.
  - `credits_charged` (number or null): What this request cost, in credits. `null` when not metered.
  - `environment` (string): Deprecated: always `live` (there are no test keys). Will be removed. One of: `"live"`. Default `"live"`.
- `next_cursor` (string or null, required)
- `results` (array of object, required)
  - `created_at` (string (date-time), required)
  - `credits_charged` (number or null, required): What the job cost, in credits, once it has ended. Null while it runs, never 0 (which reads as free). A value already known is free.
  - `entity` (string, required): One of: `"contacts"`, `"accounts"`.
  - `fields` (array of string, required)
  - `finished_at` (string (date-time) or null, required)
  - `job_id` (string, required)
  - `name` (string or null, required)
  - `status` (string, required): As of the last time the job was read. One of: `"queued"`, `"running"`, `"cancelling"`, `"completed"`, `"failed"`, `"cancelled"`.
  - `total_rows` (integer, required)
  - `stop_reason` (string or null): Why the job was stopped, when it was: `time_limit` (still running 6 hours after it started) or `no_credits` (the workspace could no longer cover it). What it found until then is charged. One of: `"time_limit"`, `"no_credits"`.
  - `suppressed_rows` (array of integer): Positions in `items` left out because they are on the Do-Not-Contact list: never looked up, never charged.
  - `values_found` (integer or null): How many values were newly found and charged for, one each whatever the field (a phone number and an email are 2), once the job has ended; rows on the Do-Not-Contact list are left out. Null while it runs. `credits_used` prices the same values, each at its field's price.

Errors:

- 401: No credential, or one that does not verify (`auth.unauthorized`).
- 403: The credential lacks the scope this route needs (`auth.insufficient_scope`), or the signed-in user has not chosen a workspace (`auth.workspace_required`).
- 422: The request is invalid (`request.invalid`), or its cursor is (`pagination.*`).
- 503: A service this request needs is unavailable, or the API is at capacity. See `Retry-After`.
- 504: The request did not finish within its time budget (`upstream.timeout`).

Example request:

```bash
curl "https://api.sproutsdata.ai/v1/enrichment/jobs?limit=20" \
  -H "X-API-Key: $SPROUTS_API_KEY"
```

The job read, results and cancel routes (`GET /v1/enrichment/jobs/{job_id}`, `GET /v1/enrichment/jobs/{job_id}/results`, `POST /v1/enrichment/jobs/{job_id}/cancel`) are specified in full at https://dashboard.sproutsdata.ai/docs/agents/api-reference/enrichment

## Errors to handle

- 400 `request.invalid`: job started without `Idempotency-Key`.
- 402 `credits.insufficient`: the hold is not covered; nothing was looked up.
- 404 `enrichment.job_not_found`: no such job in this workspace.
- 409 `enrichment.idempotency_key_reused`: key already started a different job.
- 410 `enrichment.results_expired`: rows kept 7 days after the job ended.
- 413 `request.too_large` / 422: too many items for a lookup; use a job.
- 422 `request.invalid`: wrong fields for the entity, every item on Do-Not-Contact, hold over 30,000 credits, or other validation.
- 429 `quota.burst_exceeded`: too many lookups running or jobs open, or rate limit; wait `Retry-After`.

## See also

- https://dashboard.sproutsdata.ai/docs/agents/api-reference/enrichment
- https://dashboard.sproutsdata.ai/docs/agents/guides/credits
- https://dashboard.sproutsdata.ai/docs/agents/guides/lists-and-exports
- https://dashboard.sproutsdata.ai/docs/agents/guides/rate-limits
