Campaigns
Launch a campaign from a reviewed CSV file
Creates a campaign whose recipients are the selected rows of a ready CSV review session (POST /api/campaigns/import/sessions). The JSON body names the session in importId with the campaign settings. The segments and the assignment must be the ones the review was classified for; otherwise 409 CSV_REVIEW_OUT_OF_DATE asks for a new review. A review with less than 24 hours left returns 409 CSV_IMPORT_SESSION_EXPIRING, and a review still analyzing or already launched returns 409 CSV_IMPORT_SESSION_NOT_READY. The request freezes the review, creates the campaign in the importing status and returns 202. An async operation then reads the selected rows in file order in batches: a selected new row creates a contact (exact phone match, then the org merge rules), a selected existing row uses its contact, and each row becomes one recipient in the segment the analysis gave it. ContactCreated workflows start only for the contacts it created. When every row is written the campaign moves to scheduled and the review rows and file are deleted; a campaign whose schedule date has passed is sent by the next scheduler run. A campaign is never sent while it is importing. Poll GET /api/campaigns/{id}/import for progress.
Authorization
bearerAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/campaigns/import" \ -H "Content-Type: application/json" \ -d '{ "importId": "6710b2c4e8a1d4e001a0b2e0", "name": "Spring promo", "message": "Hi {{firstName}}, our spring offer is live.", "scheduleDate": "2026-10-12T15:00:00.000Z", "selectedPhoneNumberIds": [ "64d2f9c5e8a1d4e001a0b1d0" ] }'{ "success": true, "message": "string", "operationId": "string", "data": { "_id": "665f1a0c0e0a4b001a2c9f10", "organizationId": "64ee9a8b1e7f2a0011223344", "name": "Q2 Lead Gen", "message": "Hi {{firstName}}, are you still interested in a quote?", "userIds": [ "64ee9a8b1e7f2a0011223399" ], "scheduleDate": "2026-05-20T15:00:00.000Z", "process": "64eea1110000000000000001", "contactStatus": "New Lead", "isAutopilot": false, "type": "sms", "status": "scheduled", "createdBy": { "_id": "64ee9a8b1e7f2a0011223399", "fullName": "Alex Rep" }, "failedUserIds": [], "failedDetails": [], "stats": { "total": 250, "sent": 0, "failed": 0, "successRate": "0%" }, "createdAt": "2026-05-18T12:34:56.000Z", "updatedAt": "2026-05-18T12:34:56.000Z" }}