# Check whether a campaign can start

`GET https://api.morevoice.ai/v1/campaigns/{id}/preflight`

Runs the checks that starting the campaign runs, without starting it: the same checks as the dashboard's Start button. `ok` says whether it can start; `errors` block the start, `warnings` don't. `window_open` and `next_window_at` say whether the campaign's calling window (and Shabbat and holidays) lets it dial now, and when it next can.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `campaigns_preflight`.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | A campaign ID (`cmp_…`). |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |

## Responses

### 200 OK

OK Returns `CampaignPreflight`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"campaign_preflight"` | — |
| `campaign_id` | `string` | A campaign ID (prefix `cmp_`). |
| `ok` | `boolean` | No errors: the campaign can start. |
| `errors` | `string[]` | What blocks the start (missing assistant or connection, no contacts, no marketing consent, no registry, …). |
| `warnings` | `string[]` | What the dialer will skip or delay (contacts without consent, outside calling hours now, …). |
| `dialable` | `integer` | Contacts the dialer may call. |
| `window_open` | `boolean` | Calling is allowed right now (calling hours, Shabbat, holidays). |
| `next_window_at` | `string \| null` | When calling is next allowed; null if never in the next 3 weeks. |

Example:

```json
{
  "campaign_id": "cmp_2Yb7mCq9aPLk",
  "dialable": 852,
  "errors": [],
  "next_window_at": "2026-11-02T09:00:00.000Z",
  "object": "campaign_preflight",
  "ok": true,
  "warnings": [
    "12 contact(s) have no recorded marketing consent and will be skipped"
  ],
  "window_open": true
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID (in the path or the body) exists in this organisation and mode. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const campaignPreflight = await mv.campaigns.preflight("cmp_7Hk2Lm9Qp");
console.log(campaignPreflight);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

campaign_preflight = client.campaigns.preflight("cmp_7Hk2Lm9Qp")
print(campaign_preflight)
```

**cURL**

```sh
curl https://api.morevoice.ai/v1/campaigns/cmp_7Hk2Lm9Qp/preflight \
  -H "Authorization: Bearer $MOREVOICE_API_KEY"
```
