Import campaign recipients
Uploads a recipient list as multipart/form-data: a required file part (CSV or XLSX, at most 10 MiB) and an optional mapping JSON part. The parser is chosen from the file's content, not its name.
Every column that is not the phone column becomes a prompt variable for that recipient.
Bad rows
Rows that are duplicates, unusable numbers, or carry invalid variables reject the whole file with campaign_recipients_invalid — unless mapping.skip_invalid is set, in which case they are stored as excluded and retrievable from the error report.
Imports are allowed only while the campaign is a draft, and repeat imports append.
bearerAuthAuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
id*stringuuidIdempotency-Key*stringRequired. Reuse the same key to retry this write safely. Retries and idempotency.
^[A-Za-z0-9!#$%&'*+.^_`|~-]+$1 <= length <= 255multipart/form-data- body
Multipart upload body. At most 10 MiB in total.
file*fileCSV or XLSX recipient list. The parser is chosen from the file content, not its name.
binarymapping?Steers how the uploaded columns become recipients. Sent as the mapping multipart part.
Import result and the campaign's refreshed counters.
application/json- response
campaign_id*stringuuidtotal_rows*integer0 <= valueimported*integer0 <= valueexcluded*integer0 <= valuecounters*Per-status recipient tally, always derived from the recipient rows rather than stored, so it cannot drift from reality.
curl -X POST 'https://api.kejue.co/v1/campaigns/497f6eca-6276-4993-bfeb-53cbbbba6f08/recipients/import' \ -H 'Idempotency-Key: string' \ -F 'file=string'{ "campaign_id": "78614b6c-fe7c-41e2-8e25-c9b3a3c91904", "total_rows": 0, "imported": 0, "excluded": 0, "counters": { "total": 0, "pending": 0, "queued": 0, "calling": 0, "completed": 0, "failed": 0, "canceled": 0, "excluded": 0 }}