Skip to main content
POST

Upload contact list

Uploads a CSV file as a new contact list of the campaign — the same as Add list in the dashboard. The file is validated right away and imported in the background; use the returned file_data_id to follow the import with Get list import progress.

Endpoint

Path parameters

string
required
Campaign UUID.

Request headers

string
required
Bearer token. Format: Bearer talq_your_environment_token_here
string
required
multipart/form-data

Request body

file
required
CSV file (.csv or .txt). Up to 20,000 rows and 25 MB.

File format

  • The file must have a to column with the phone numbers. In the dashboard the column mapping renames your phone column to to; over the API nothing renames it, so send the header as to.
  • Every other column becomes a variable of the contact, under the header exactly as written: a Nome column is {Nome} in the agent prompt.
  • An optional source column tags each contact (defaults to CSV). An optional allow_duplicates column lets a row in even when the number is already pending in the campaign.
  • Numbers on the campaign’s do-not-call list, numbers already pending and numbers still in their cooldown are skipped during the import.
  • Debt collection environments need a phone column (to, phone or phone_1, phone_2…) and a document column (document, cpf, cnpj…).

Examples

Response

202 Accepted — the list was stored and its import is queued.
warnings lists columns with empty values (blank, -, N/A…). They never block the upload.

Error responses

422 — Invalid file

The file was refused and nothing was imported: no to column, more than 20,000 rows, empty file, not a CSV, or over 25 MB.

404 — Campaign not found

The campaign does not exist or belongs to another environment.