Campaigns

Upload a campaign CSV file for review

POST
/api/campaigns/import/sessions

Uploads a campaign CSV file and starts its analysis. Multipart body: file (the CSV) and config, a JSON string with the segments and the assignment the rows are classified for. The request checks the file, stores it and returns 202 with the review session in the analyzing status. An async operation then reads the file in batches of 1,000 rows and writes one review row per data row in a review group (see CampaignCsvRowCategory). It creates and changes no contact. Rows of new, existing, outbound and inbound start selected, other_users rows are opt-in, and protected, duplicate, invalid and outside_segments rows cannot be selected. A review session belongs to the user who uploaded it; other users get 404. A session that is not launched is deleted with its rows 7 days after the upload. The file may hold at most CAMPAIGN_CSV_MAX_ROWS data rows (default 250,000; more returns 400) and CAMPAIGN_CSV_MAX_BYTES bytes (default 50 MB; more returns 413). Poll GET /api/campaigns/import/sessions/{importId} until status is ready.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/campaigns/import/sessions" \  -F file="string"
{  "success": true,  "data": {    "importId": "6710b2c4e8a1d4e001a0b2e0",    "status": "ready",    "fileName": "contacts.csv",    "totalRows": 3,    "analyzedRows": 3,    "counts": {      "new": {        "total": 1,        "selected": 1      },      "existing": {        "total": 0,        "selected": 0      },      "outbound": {        "total": 1,        "selected": 1      },      "inbound": {        "total": 0,        "selected": 0      },      "other_users": {        "total": 0,        "selected": 0      },      "protected": {        "total": 0,        "selected": 0      },      "duplicate": {        "total": 1,        "selected": 0      },      "invalid": {        "total": 0,        "selected": 0      },      "outside_segments": {        "total": 0,        "selected": 0      }    },    "segmentSelected": {},    "selectedTotal": 2,    "campaignId": null,    "error": null,    "operationId": "string"  }}