---
search:
  tags:
    - imports-management
    - PUT
seo:
  description: >-
    Replaces all field mappings for an import in a single… Reference for the PUT
    /imports-management/{importId}/mappings endpoint in the Leadtime Public API
    API.
sidebar:
  badge: PUT
  label: Update all import mappings in bulk
title: Update all import mappings in bulk
type: openapi-operation
---
Replaces all field mappings for an import in a single request. This is the primary way to configure how CSV columns map to entity fields.

**What this does:**
- Deletes all existing mappings for the import
- Creates new mappings from your request
- Automatically adds dependency mappings (e.g., if you map OrganizationMember, it will also create Organization mapping if needed)
- Validates that all column IDs exist in the import
- Triggers re-validation of all mappings
- Returns the updated mappings in AI format

**AI Mapping Format:**
Each mapping specifies an entity type and its field mappings:
```json
{
  "mappings": [
    {
      "type": "Employee",
      "fields": {
        "firstName": { "mapTo": "column-uuid-here" },
        "lastName": { "mapTo": "column-uuid-here" },
        "email": { "mapTo": "column-uuid-here" },
        "role": {
          "mapTo": "column-uuid-here",
          "valueMappings": { "Manager": "manager", "Developer": "developer" }
        }
      },
      "customLookupFields": ["email"]  // optional: fields to use for finding existing records
    }
  ]
}
```

**Field Mapping Properties:**
- `mapTo`: **Required** - The UUID of the CSV column (get column IDs from GET /&#123;importId&#125;)
- `defaultValue`: Optional - Default value if CSV cell is empty
- `valueMappings`: Optional - Map CSV values to entity values (e.g., "Yes" → true, "Manager" → "manager")

**Custom Lookup Fields:**
Specify which fields should be used to find existing records for updates. If a record matches on these fields, it will be updated; otherwise, a new record will be created.
- Can include both built-in fields (e.g., "email", "firstName") and custom fields (e.g., "customField_abc123")
- If not specified, uses the entity's default `requiredToUpdate` fields
- Example: Use "email" for Employees, or a custom "externalId" field for Projects

**Important Notes:**
- `mapTo` must be a column UUID from the import (get from GET /&#123;importId&#125; response), not a column name
- All column IDs must exist in the import
- Dependencies are automatically created (e.g., Organization for OrganizationMember, Project for Task)
- Custom fields are referenced as `customField_{fieldId}` in field names
- After updating, run a dry-run to validate mappings before execution

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