Skip to main content

Upload

Start an email generation job from a CSV. Processing runs in the background — the response returns a job_id you poll for progress.

Endpoint​

Method: POST Path: /email-generation/upload/ Full URL: https://backend.ecoreservice.com/api/v1/email-generation/upload/ Auth: Authorization: Bearer <JWT> Content-Type: application/json (JSON array) or multipart/form-data (file upload)

Request​

Submit contacts either as a file or as a JSON array — same contact fields as Validate (first_name, last_name, company_domain required).

Option A — File upload (multipart/form-data)​

FieldTypeRequiredNotes
csv_filefileYesCSV/Excel of contacts
list_namestringNoDisplay label. Defaults to the file name.

Option B — JSON body (application/json)​

A JSON array of contact objects:

[
{ "first_name": "Jane", "last_name": "Doe", "company_domain": "acme.com" },
{ "first_name": "John", "last_name": "Roe", "company_domain": "globex.com", "ec_id": "1002" }
]

Successful Response — 201 Created​

{ "job_id": 123, "uuid": "…", "list_name": "Q3 prospects", "total_records": 4000, "status": "Uploading" }
FieldTypeDescription
job_idintegerUse this in the Job Status, Records, and Download paths
uuidstringUUID4
list_namestringDisplay label
total_recordsintegerContacts accepted for processing
statusstring"Uploading" immediately on creation

Keep the job_id and poll the job. Credits (total_records × 5) are charged upfront and refunded for contacts with no email found.

Error Responses​

HTTPWhenBody
400Missing/invalid file, missing required columns, or empty file{ "error": "..." }
402Wallet can't cover total_records × 5{ "error": "Insufficient credits. You need 20000 credits but have 5000.", "required": 20000, "balance": 5000 }

See Error Codes for the full list.