---
search:
  tags:
    - imports-management
    - POST
seo:
  description: >-
    Executes the import to create and update entities in… Reference for the POST
    /imports-management/{importId}/execute endpoint in the Leadtime Public API
    API.
sidebar:
  badge: POST
  label: Execute import and persist data
title: Execute import and persist data
type: openapi-operation
---
Executes the import to create and update entities in the database. This is the final step that actually persists your data.

**What this does:**
- Queues the import for background processing (avoids timeout for large files)
- Returns immediately with queued status
- Processes all rows asynchronously in the background
- Creates new entities and updates existing ones based on lookup fields
- Updates import status and progress statistics in real-time

**Before Executing:**
⚠️ **Important**: Always run a dry-run first to preview results!
- Verify mappings are correct using GET /&#123;importId&#125;
- Run POST /&#123;importId&#125;/dry-run to preview what will happen
- Review dry-run results and fix any issues
- Only execute when you're confident the results are correct

**How to Track Progress:**
1. Call this endpoint to start execution (returns immediately)
2. Poll GET /&#123;importId&#125; to check status and progress
3. Monitor these fields:
   - `status`: Current import status
   - `processedEntities` / `totalToProcess`: Progress percentage
   - `totalCreatedEntities` / `totalUpdatedEntities` / `totalSkippedEntities`: Final counts

**Import Status Values:**
- `Uploaded`: Import created, ready for execution
- `Processing`: Import is currently running (check `processedEntities` for progress)
- `Completed`: Import finished successfully (see final statistics)
- `Failed`: Import encountered errors (check error message if available)

**Processing Performance:**
- Processing time depends on row count and entity complexity
- Typically 1-5 seconds per 100 rows
- Large imports (1000+ rows) may take several minutes
- Progress is updated in real-time, so you can monitor via GET /&#123;importId&#125;

**What Happens During Execution:**
- Each row is processed sequentially
- System uses lookup fields to find existing records
- If found: record is updated with new values
- If not found: new record is created
- Validation errors cause rows to be skipped
- Dependencies are automatically created (e.g., Organization before OrganizationMember)

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