Skip to Content
Campaigns

Preview a recipient upload

Permissioncampaigns:updateAdd-onCampaignsRetriesIdempotency-Key requiredAuthentication
POST
/campaigns/{id}/recipients/preview

Parses an upload and reports what an import would do — detected headers, the inferred phone column, per-row validation, and a sample — without storing anything. Same multipart shape as the import. When no phone column can be inferred the response returns the headers with a null phone_column so the caller can choose one and preview again.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Path Parameters

id*string
Formatuuid

Header Parameters

Idempotency-Key*string

Required. Reuse the same key to retry this write safely. Retries and idempotency.

Match^[A-Za-z0-9!#$%&'*+.^_`|~-]+$
Length1 <= length <= 255

Request Body

multipart/form-data
  1. body

Multipart upload body. At most 10 MiB in total.

file*file

CSV or XLSX recipient list. The parser is chosen from the file content, not its name.

Formatbinary
mapping?

Steers how the uploaded columns become recipients. Sent as the mapping multipart part.

Response Body

What an import of this file would do.

application/json
  1. response

What an import of the uploaded file would do. Nothing is stored.

headers*array<string>
phone_column*|

The resolved dial-target column, or null when none could be inferred — supply mapping.phone_column and preview again.

total_rows*integer
Range0 <= value
valid_rows*integer
Range0 <= value
invalid_rows*integer
Range0 <= value
duplicate_rows*integer
Range0 <= value
sample*array<>

First rows of the file, for confirming the column mapping.

issues*array<>

Problem rows, capped at 200 entries.

issues_total*integer

Total problem rows, which may exceed the reported issues.

Range0 <= value
Example Request
curl -X POST 'https://api.kejue.co/v1/campaigns/497f6eca-6276-4993-bfeb-53cbbbba6f08/recipients/preview' \  -H 'Idempotency-Key: string' \  -F 'file=string'
Example Response
{  "headers": [    "string"  ],  "phone_column": "string",  "total_rows": 0,  "valid_rows": 0,  "invalid_rows": 0,  "duplicate_rows": 0,  "sample": [    {      "row_number": 1,      "phone": "string",      "variables": {        "property1": "string",        "property2": "string"      },      "issue": "string"    }  ],  "issues": [    {      "row_number": 1,      "code": "duplicate",      "message": "string"    }  ],  "issues_total": 0}