---
search:
  tags:
    - imports-management
    - POST
seo:
  description: >-
    Uploads a CSV file and automatically creates an import with… Reference for
    the POST /imports-management/upload endpoint in the Leadtime Public API API.
sidebar:
  badge: POST
  label: Upload CSV file and generate AI mappings
title: Upload CSV file and generate AI mappings
type: openapi-operation
---
Uploads a CSV file and automatically creates an import with AI-powered field mapping suggestions.

**What this does:**
This is the first step in the import workflow. When you upload a CSV file, the system:
1. Parses the CSV file and extracts column metadata (names, data types, sample values)
2. Stores the file data and first 10 sample rows for preview
3. Uses AI to analyze the CSV structure and suggest field mappings
4. Generates mapping suggestions for supported entity types (Employee, Organization, Project, Task, etc.)
5. Returns the import details with suggested mappings ready for review

**Supported Entity Types:**
- `Employee`: Import employee data (name, email, role, etc.)
- `Organization`: Import organization/client data
- `OrganizationMember`: Import organization membership relationships
- `Project`: Import projects with custom fields support
- `Task`: Import tasks with custom fields support
- `TaskComment`: Import task comments

**File Requirements:**
- File must be CSV format (text/csv, application/csv, or text/plain MIME types)
- First row should contain column headers
- File will be parsed with automatic delimiter detection

**AI Mapping Features:**
- Automatically detects which columns map to which entity fields
- Suggests value mappings for enums (e.g., "Manager" → "manager" role)
- Handles custom fields for Projects and Tasks
- Identifies relationships and dependencies (e.g., Organization for OrganizationMember)

**Next Steps:**
After upload, review the suggested mappings using GET /&#123;importId&#125;, then:
1. Modify mappings if needed using PUT /&#123;importId&#125;/mappings
2. Run a dry-run using POST /&#123;importId&#125;/dry-run to preview results
3. Execute the import using POST /&#123;importId&#125;/execute to persist data

**Note:** The AI mapping may not be perfect - always review and test with dry-run before executing.

<Operation source="api-reference" id="importsmanagementcontroller-uploadfile" />
