---
title: "Apply a mapped CSV lead import"
method: POST
path: "/api/leads/imports/apply"
tags: ["Leads"]
---

# Apply a mapped CSV lead import

`POST /api/leads/imports/apply`

## Request

- Base URL: `https://api.setluca.com`
- URL: `https://api.setluca.com/api/leads/imports/apply`
- Auth: one of:
  - API key in cookie `luca.session_token`
  - API key in header `x-api-key`
  - HTTP bearer

Commits the import that `/api/leads/imports/preview` described, using the same mapping. `Idempotency-Key` is required here. Without it, a retried request would run the whole file twice.

**API key scopes:** `leads:write`. You also need an `Idempotency-Key` header.

## Headers

- `Luca-API-Version` '1'

## Request body

- LeadImport
  - `source` string
  - `rows` object[], required
  - `mapping` object, required
    - `identity` object, required
      - `channelColumn` string
      - `channelDefault` 'telegram' | 'instagram' | 'messenger' | 'whatsapp'
      - `externalUserIdColumn` string, required
      - `displayNameColumn` string
    - `tagsColumn` string
    - `tagsDelimiter` string
    - `stageColumn` string
    - `customFields` object
    - `identities` object[]
      - `channelColumn` string
      - `channelDefault` 'telegram' | 'instagram' | 'messenger' | 'whatsapp'
      - `externalUserIdColumn` string, required
      - `displayNameColumn` string
      - `verificationStatus` 'inferred' | 'claimed' | 'verified' | 'rejected'
      - `source` string
    - `consents` object[]
      - `channelColumn` string
      - `channelDefault` 'telegram' | 'instagram' | 'messenger' | 'whatsapp'
      - `purpose` 'booking_reminders' | 'marketing' | 'sales_follow_up' | 'support', required
      - `grantedColumn` string, required
      - `evidenceColumn` string
      - `source` string

## Response `200`

ok

- unknown

## Other responses

- `400`: bad request
- `401`: unauthorized
- `429`: rate limited
- `500`: internal error
- `503`: service unavailable

---

[API](https://skmtc.dev/setluca/apis/luca-api.md) · [All operations](https://skmtc.dev/setluca/apis/luca-api/llms.txt) · [OpenAPI document](https://skmtc.dev/setluca/apis/luca-api/revisions/90a200e4100b?raw)
