AISARAISAR
REST API

Broadcasts

Bulk message broadcasts to a segment of contacts across one or more channels. A broadcast can be saved as a draft (`is_draft: true`) and later launched immediately, scheduled, or set up as recurring. Lifecycle: draft → publish → run(s); each run tracks its own progress (sent/delivered/read/failed).

Endpoints

MethodPath
GET/v1/broadcasts/meta

Broadcast builder metadata (segments, variables, templates)

GET/v1/broadcasts

List broadcasts (paginated, filterable by status)

GET/v1/broadcasts/{broadcast}

Get a broadcast

POST/v1/broadcasts

Create a broadcast (supports is_draft)

PATCH/v1/broadcasts/{broadcast}

Update a broadcast

DELETE/v1/broadcasts/{broadcast}

Delete a broadcast

POST/v1/broadcasts/estimate

Estimate broadcast audience size

POST/v1/broadcasts/{broadcast}/duplicate

Duplicate a broadcast

POST/v1/broadcasts/{broadcast}/publish

Publish a draft (launch it or schedule it)

POST/v1/broadcasts/{broadcast}/cancel

Cancel a one-off broadcast

POST/v1/broadcasts/{broadcast}/run

Manually trigger a broadcast run

GET/v1/broadcasts/{broadcast}/messages

Run recipients (paginated, filterable by status)

GET/v1/broadcasts/{broadcast}/runs

List broadcast runs

GET/v1/broadcasts/{broadcast}/runs/{run}

Get a specific run

POST/v1/broadcasts/{broadcast}/pause-recurring

Pause a recurring schedule

POST/v1/broadcasts/{broadcast}/resume-recurring

Resume a recurring schedule

Examples

Create and immediately launch a broadcast

Request

bash
curl -X POST https://api.aisar.app/v1/broadcasts \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "February promo",
    "is_draft": false,
    "audience": { "segmentId": "12" },
    "channels": { "mode": "specific", "channelIds": [7] },
    "content": {
      "channels": [
        { "type": "text", "channelId": 7, "accountType": "whatsapp", "text": "Hi {{first_name}}, 20% off this week!" }
      ]
    },
    "schedule": { "mode": "now" }
  }'

Response

json
{
  "data": {
    "id": 88,
    "company_id": 1,
    "name": "February promo",
    "status": "active",
    "audience": {
      "conditions": [],
      "group_logic": "and"
    },
    "channels": [{ "id": 7, "mode": "specific" }],
    "content": [],
    "schedule": { "mode": "now", "scheduledAt": null },
    "recurring_schedule": null,
    "runs": [
      { "id": 201, "broadcast_id": 88, "status": "processing", "total": 340, "sent": 0, "failed": 0, "delivered": 0, "read": 0, "started_at": "2026-03-15T10:00:00.000000Z", "completed_at": null }
    ],
    "created_at": "2026-03-15T10:00:00.000000Z",
    "updated_at": "2026-03-15T10:00:00.000000Z"
  }
}

Estimate broadcast audience

Request

bash
curl -X POST https://api.aisar.app/v1/broadcasts/estimate \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "segment_id": 12,
    "channel_ids": [7]
  }'

Response

json
{
  "data": {
    "total_contacts": 340,
    "reachable_contacts": 312,
    "excluded_contacts": 28,
    "estimated_duration_seconds": 312,
    "estimated_completion": "2026-03-15T10:05:12.000Z"
  }
}