> ## Documentation Index
> Fetch the complete documentation index at: https://docs.auxia.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload and Validate

After filling out your CSV template, use the Upload and Validate tab to upload your file, validate the data, review any errors, and create the treatments.

## **Upload Process Overview**

The upload process consists of three main steps:

1. **Upload CSV File**: Select and upload your filled CSV file
2. **Validation**: System validates all data in the CSV
3. **Review and Confirm**: Review validation results and confirm upload

***

## **Step 1: Upload Your CSV File**

### Accessing the Upload Tab

1. Navigate to **Manage** → **Treatments** → **Bulk Upload**
2. Click on the **Upload and Validate** tab
3. Click the **"Upload CSV"** button or drag and drop your file

### File Requirements

* **Format**: CSV (Comma-Separated Values)
* **Encoding**: UTF-8
* **Maximum Rows**: 100 treatments (plus 1 header row and optional documentation row)

<Note>
  The CSV file must use the exact template structure generated for your project. Using an old template or manually created CSV may cause validation errors.
</Note>

## **Step 2: Validation**

Once you upload the CSV file, the system automatically validates:

* **Header Validation**
  * All required columns are present
  * No extra columns have been added
  * Column names match the template exactly (including case)

* **Row Structure Validation**
  * Number of columns matches header row
  * Number of treatment rows does not exceed 100
  * No rows have extra columns

* **Data Validation**

  For each treatment row, the system checks:

  * **Required Fields**
    * `Treatment type` is not empty
    * `Name` is not empty (max 100 characters)
    * `Description` is not empty
    * `Start timestamp` is not empty and valid UTC format
    * `Target action` is not empty (if required by project settings)
    * `Surfaces` is not empty

  * **Field Format Validation**
    * **Timestamps**: Must be in valid UTC format
    * **Tags**: Must be semicolon-separated, all tags must exist in project
    * **Target Action**: Event must exist, properties must match event definition
    * **Surfaces**: Must be semicolon-separated, all surfaces must be associated with treatment type
    * **MEG**: Must exist in project
    * **Content Fields**: Must not exceed maximum character limits

  * **Qualification Criteria Validation**

    For each qualification criterion (numbered 1, 2, 3, etc.):

    * **Qualification field**: Must exist in project or be a valid Self Referencing Treatment Interaction (format: `InteractionType_(THIS_TREATMENT)_TimeWindow`)
    * **Qualification condition**: Must be valid for the data field type
    * **Qualification value**: Must match the expected format for the condition
    * **Apply qualification if attribute not available**: Only valid for User Attribute data fields; must be TRUE, FALSE, or empty

***

## **Step 3: Review Validation Results**

After validation completes, you'll see one of two outcomes:

### Success: No Errors

If validation passes:

* **Preview table** displays all treatments that will be created
* **"Confirm Upload"** button becomes enabled

**Preview Table** shows:

* Treatment name
* Description
* Start/end timestamps
* Tags
* Qualification criteria
* Any other configured fields

### Failure: Validation Errors

If validation fails:

* **Error table** displays all validation errors
* **"Re Upload"** button appears

#### Error Table Columns

| Column        | Description                                                                  |
| ------------- | ---------------------------------------------------------------------------- |
| Row Number    | The exact row number in your CSV file (matching the row in your spreadsheet) |
| Column Name   | The specific column with the error                                           |
| Error Type    | Category of error                                                            |
| Error Message | Description of what's wrong                                                  |

#### Error Types

* `MISSING_REQUIRED_FIELD` - A required field is empty
* `INVALID_FORMAT` - Data format is incorrect
* `INVALID_TIMESTAMP` - Timestamp format is invalid
* `INVALID_VALUE` - Value doesn't meet constraints (includes invalid conditions)
* `INVALID_TAG` - Tag doesn't exist in project
* `TARGET_ACTION_NOT_FOUND` - Target action event doesn't exist
* `SURFACE_NOT_AVAILABLE_FOR_TREATMENT_TYPE` - Surface not valid for this treatment type
* `MUTUAL_EXCLUSION_GROUP_NOT_FOUND` - MEG doesn't exist
* `DATA_FIELD_NOT_FOUND` - Data field ID doesn't exist

***

## **Step 4: Fix Errors and Re-upload**

If validation fails:

1. **Open your original CSV file**
2. **Fix the errors** based on the error messages:
   * Navigate to the specific row and column mentioned
   * Correct the issue (refer to [CSV Field Reference](/bulk-upload/csv-field-reference) for proper formats)
   * Save the file
3. **Re-upload** the corrected CSV file
4. **Wait for validation** to complete again

<Note>
  Fix all errors before re-uploading. The system will re-validate the entire file each time.
</Note>

### Common Fixes

* **Timestamp Errors**
  * **Error**: "Start timestamp must be in UTC format"
  * **Fix**: Use format `MM/dd/yyyy hh:mm a`
  * **Example**:
    ```
    Before: 2024-06-01 00:00:00
    After:  06/01/2024 12:00 AM
    ```

* **Tag Errors**
  * **Error**: "Tag 'promo' does not exist in the project"
  * **Fix**: Create the tag in the console first, or use an existing tag

* **Target Action Errors**
  * **Error**: "Event 'purchase' does not have property 'category'"
  * **Fix**: Verify the event name and property names match your project exactly
  * **Example**:
    ```
    Before: purchase (category: premium)
    After:  purchase (product_type: premium)
    ```

* **Data Field Errors**
  * **Error**: "Data field with ID 99999 not found"
  * **Fix**: Verify the data field ID exists in **Manage → Data → Data Fields**

* **Invalid Self Referencing Treatment Interaction**
  * **Error**: "Invalid treatment data field value"
  * **Fix**: Use the correct format: `InteractionType_(THIS_TREATMENT)_TimeWindow`
  * **What this is**: A special data field tracking user interactions with this specific treatment (e.g., clicks, views)
  * **Example**:
    ```
    Before: viewed_last_7d
    After:  Viewed_(THIS_TREATMENT)_last_7d
    ```

* **Data Missing Behaviour Errors**
  * **Error**: "Data missing behaviour can only be set for User Attribute data fields"
  * **Fix**: Only set the "Apply qualification N if attribute not available" field for User Attribute data fields, not for Self Referencing Treatment Interaction fields or event-based fields

***

## **Step 5: Confirm Upload**

Once validation passes with no errors:

1. **Review the preview table** to ensure all treatments look correct
2. **Click "Confirm Upload"** button
3. **Wait for creation to complete**

### Upload Progress

* Progress bar shows percentage complete
* Status updates as treatments are created
* Estimated time remaining is displayed

<Note>
  Do not close the browser tab or navigate away during upload. This may interrupt the process.
</Note>

### Upload Results

After upload completes, you'll see:

#### Success Summary

* ✅ Number of treatments successfully created
* Treatment IDs assigned
* Timestamp of upload completion

#### Partial Success/Failure

If some treatments fail during creation:

* ✅ Number of successful treatments
* ❌ Number of failed treatments
* **"Download Results"** button to see which treatments failed and why

***

## **Tips for Successful Uploads**

1. **Start Small**: Test with 5-10 treatments first before uploading large batches
2. **Validate Early**: Generate template and fill one row to validate the format works
3. **Keep Backups**: Save a copy of your CSV before making changes
4. **Fix All Errors**: Don't ignore validation errors - they will prevent upload
5. **Check Prerequisites**: Ensure tags, MEGs, and events exist before uploading
6. **Use Exact Names**: Field values are case-sensitive - match them exactly
7. **Documentation Row**: You can keep or remove the documentation row at the top - either way works fine
8. **Use Generated Template**: Always start with a freshly generated template to ensure you have the latest column headers

***

**Next**: Check [Bulk Upload History](/bulk-upload/bulk-upload-history) to view past uploads and their results.
