`lumail@2.1.0` · [`lumail.campaigns`](/docs/sdk/v2/campaigns)

```typescript
campaigns.send(campaignId: string, params?: SendCampaignParams): Promise<LumailResult<SendCampaignResponse>>
```

No date sends immediately. Optional `scheduledAt` and `timezone`. The SDK sends `{}` when `params` is omitted.

## Path Parameters

| Name | Type | Description |
| ------------ | ------ | -------------------------- |
| `campaignId` | string | **Required.** Campaign id. |

## Body Parameters

| Name | Type | Description |
| ------------- | ------ | ------------------------------------------------------------------- |
| `scheduledAt` | string | ISO 8601 datetime. Omit to send immediately. Must be in the future. |
| `timezone` | string | IANA timezone for the schedule. |

## Response Fields

| Field | Type | Description |
| ------------- | ------------------------------------ | ------------------------ |
| `id` | string | Campaign id. |
| `campaignId` | string | Optional alias of `id`. |
| `status` | `"SCHEDULED"` / `"SENDING"` / string | New status. |
| `scheduledAt` | string | Scheduled time when set. |
| `timezone` | string | Timezone when set. |

`data` is the send result. Failures return `{ data: null, error: { name, message, statusCode } }`.


## API Reference
**Method:** POST
**Endpoint:** /api/v2/campaigns/:campaignId/send

### SDK
```ts
import { Lumail } from "lumail";

const lumail = new Lumail({ apiKey: process.env.LUMAIL_API_KEY });
const { data, error } = await lumail.campaigns.send("cmp_abc123", {
  scheduledAt: "2026-06-01T09:00:00Z",
  timezone: "Europe/Paris",
});
if (error) {
  throw error;
}
console.log(data.status, data.scheduledAt);
```

### cURL
```bash
curl -X POST https://lumail.io/api/v2/campaigns/cmp_abc123/send \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"scheduledAt":"2026-06-01T09:00:00Z","timezone":"Europe/Paris"}'
```

### JavaScript
```javascript
const response = await fetch("https://lumail.io/api/v2/campaigns/cmp_abc123/send", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    scheduledAt: "2026-06-01T09:00:00Z",
    timezone: "Europe/Paris",
  }),
});
const data = await response.json();
```

### Success Response
```json
{
  "id": "cmp_abc123",
  "status": "SCHEDULED",
  "scheduledAt": "2026-06-01T09:00:00.000Z",
  "timezone": "Europe/Paris"
}
```

### Error Response
```json
{
  "name": "validation_error",
  "message": "Campaign must include an unsubscribe link",
  "statusCode": 422
}
```
