# Preflight

> Is the workspace ready for a campaign?

Source: https://docs.mycrmsim.com/docs/dbr-campaigns/dbr-preflight

```http
GET https://backend.mysmsgateway.app/api/v1/ext/dbr-campaigns/preflight
```

- Category: myCRMSIM DBR Campaigns / DBR Campaigns
- Auth: Bearer access token
- Scope: `dbr_campaigns.read`

A campaign needs the account's AI key, a reply model, and a device that can send. `ok` is true when all three are there; otherwise `message` says what is missing.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `workspace_id` | query | number | yes | A workspace of the installer. Example: `7` |

## Response 200

OK

```json
{
  "success": true,
  "data": {
    "ok": true,
    "has_key": true,
    "agent_model_configured": true,
    "message": "Ready to build a reactivation campaign.",
    "device": {
      "ok": true,
      "devices": 2,
      "enabled": 2,
      "online": 1
    }
  }
}
```

## Response 401

Missing or invalid token

```json
{
  "success": false,
  "message": "Invalid or expired access token."
}
```

## Response 403

Missing scope

```json
{
  "success": false,
  "message": "Missing scope(s): dbr_campaigns.read. This integration was granted: …"
}
```

## Response 404

workspace_id does not exist or is not the installer's (same response for both)

```json
{
  "success": false,
  "message": "Workspace not found or not accessible to this token"
}
```

## Response 502

The campaign service could not be reached

```json
{
  "success": false,
  "message": "The campaign service could not be reached. Try again later."
}
```
