---
title: "Create a leads-to-email workflow from a CSV: enrich the leads, compose AI emails, and enroll them into a sequence"
method: POST
path: "/v1/leads-to-email"
tags: ["leads-to-email"]
---

# Create a leads-to-email workflow from a CSV: enrich the leads, compose AI emails, and enroll them into a sequence

`POST /v1/leads-to-email`

## Request

- Base URL: `https://developer.saleshandy.com` (the document declares no server; this is the origin it was published from)
- URL: `https://developer.saleshandy.com/v1/leads-to-email`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/saleshandy/apis/develop-with-saleshandy/docs/v1/leads-to-email/post.ts> (a function with typed inputs; its response is checked against the schema)

<strong>Content-Type</strong>: <code>multipart/form-data</code> with a <code>file</code> field (the CSV) plus the text fields below. JSON-valued fields (<code>columnMapping</code>, <code>exportColumns</code>, <code>filters</code>) must be sent as stringified JSON.

## Request body `multipart/form-data`

- object
  - `file` string, binary, required: CSV file with the leads to enrich
  - `fileName` string
  - `totalRecords` string, required
  - `revealType` string, required
  - `columnMapping` string, required
  - `exportColumns` string
  - `webhookUrl` string
  - `filters` string
  - `bodyTemplateId` string
  - `subjectTemplateId` string
  - `steps` string
  - `stepGap` string
  - `stepContent` string: Stringified JSON array of caller-provided steps; skips AI compose

## Response `201`

Workflow created. Returns the workflow id to track progress.

- object
  - `message` string
  - `payload` object
    - `success` boolean
    - `id` string
    - `status` string

## Other responses

- `400`: 4000: Failed to create leads-to-email workflow<br><br>
- `401`: 1001: Invalid token<br><br>
- `413`: CSV file exceeds the 50 MB upload limit

## Changes

- **2026-09-16** `a483e105b20f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/saleshandy/apis/develop-with-saleshandy/changes/v1/leads-to-email/post.md)

---

[API](https://skmtc.dev/saleshandy/apis/develop-with-saleshandy.md) - [All operations](https://skmtc.dev/saleshandy/apis/develop-with-saleshandy/llms.txt) - [OpenAPI document](https://skmtc.dev/saleshandy/apis/develop-with-saleshandy/revisions/e7a29c931aa7?raw)
