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

# Enrich a CSV file

`POST /api/v1/enrich/csv`

Authentication: API key.

`Content-Type: multipart/form-data` with field `file`, or raw POST with `Content-Type: text/csv` and `mode` / `mapping` on the query string.

**Column mapping**, map `email` to your work-email column (required). Omit `profileUrl` in mapping to write found professional profile URLs to `ProfileURL`.

CSVs need at least two columns, delimiter auto-detection fails on single-column files with a `400`. If you only have emails, add any second column (even an empty one).

**File size:** there is no row cap on CSVs, but this synchronous route processes the file inline and the gateway times out at 60 seconds, in practice around 5,000 rows per request; larger files return `504` with no partial result. For bigger files, split into ~5,000-row chunks, or use the async CSV upload flow (app to Enrichment, or the MCP tool `create_csv_enrichment_upload_link`), which processes files of any size in the background. The "~10,000 enrichments per minute" figure above is throughput across requests, not a per-file cap.

**Output columns**, on success, every scalar provider field in `data` becomes an `enriched_*` column (e.g. `enriched_first_name`, `enriched_job_title`). Convenience columns `email` and `ProfileURL` are written when mapped (or use defaults above). Nested objects from the provider are omitted (same as JSON batch `data`).

Successful CSV responses return `200` with body = enriched CSV (not JSON). Headers: `X-Enrich-Total`, `X-Enrich-Succeeded`, `X-Enrich-Skipped`, `X-Enrich-Partial`, `X-Credits-Remaining` (empty when unlimited). Use `curl -D headers.txt` to inspect.

### Body parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `mode` | string | yes |  | Set to `work_email` (`email`). |
| `file` | file | yes |  | CSV file (multipart) or raw body (`text/csv`). |
| `mapping` | JSON string | yes |  | Maps semantic keys to your column headers (see below). |
| `maxRows` | number | no |  | Optional cap on rows processed (multipart field or `?maxRows=`). |
| `fileName` | string | no |  | Optional label stored in run history. |

### Example request

```bash
curl -sS -X POST "https://leadmcp.ai/api/v1/enrich/csv" \
  -H "X-API-Key: lb_live_YOUR_API_KEY" \
  -F "file=@./contacts.csv" \
  -F "mode=work_email" \
  -F 'mapping={"email":"Work_Email"}'
```
