Skip to main content
POST
/
v1
/
api
/
filesupload
/
Upload CSV or XLSX File
curl --request POST \
  --url https://base.sanitizeemail.com/v1/api/filesupload/ \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-API-KEY: <api-key>' \
  --form 'name=Customer List' \
  --form email_column=email_address \
  --form is_file_organised=true \
  --form file_tag=clean \
  --form file=@example-file
{
  "error": "<string>",
  "is_first_time": true,
  "available_columns": [
    "<string>"
  ],
  "sample_first_3_rows": [
    {}
  ]
}
This endpoint allows users to upload CSV or XLSX files for bulk email validation. It supports both organized files (with headers) and unorganized files, with intelligent email column detection.

How it Works

1

Upload File

Submit your CSV or XLSX file with the required parameters
2

Column Detection

If is_file_organised is true, the API automatically detects email columns
3

Column Selection (if needed)

If no email column is found, you’ll receive suggestions to choose the correct column
4

Processing

Resubmit with the chosen email_column to start validation

Important Notes

Column Selection: You can always provide an email_column parameter, even on the first upload. It’s particularly useful when you know the exact column name containing email addresses.
File Resubmission: If you receive a 200 response with available_columns, resubmit the same file with the chosen email_column to proceed with processing.
File Organization: Set is_file_organised=false for files without headers or with inconsistent structure. The API will attempt to detect emails from the raw data.

Authorizations

X-API-KEY
string
header
required

API key for authentication

Body

multipart/form-data

File upload with form data

file
file
required

The CSV or XLSX file to upload for email validation

name
string
required

Display name for the uploaded file

Example:

"Customer List"

is_file_organised
boolean
required

Whether the file has a structured format with column headers. Set to true for files with headers, false for unorganized data.

Example:

true

file_tag
enum<string>
required

Tag to categorize the file processing type. 'clean' removes invalid emails, 'validate' checks email validity, 'analyze' provides detailed email insights.

Available options:
clean,
validate,
analyze
Example:

"clean"

email_column
string

Name of the column containing email addresses. Optional on first upload, but required if the API returns column suggestions.

Example:

"email_address"

Response

File uploaded but requires email column selection

error
string

Error message indicating no email columns found

is_first_time
boolean

Whether this is the first upload attempt

available_columns
string[]

List of available column names in the file

sample_first_3_rows
object[]

Sample of first 3 rows to help identify the correct email column