> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orbit.devotel.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Worked request and response samples

> Worked samples for the most-used campaign operations: create a campaign, test its timing, and launch it. Each sample shows the request, the success envelope, and the error envelope to expect.

## Worked request and response samples

Copy a request body as written, substitute your own ids, and compare the response envelope. Errors follow Devotel Orbit's `{ error, meta }` envelope, shown once below under **Error envelope**.

<Note>
  **Auto-winner governance.** `POST /campaigns/{id}/variants` accepts three optional knobs that gate the automatic winner-promotion scheduler: `ab_auto_promote` (boolean | null — `false` keeps every promotion behind the manual `POST /campaigns/{id}/ab-select-winner` call, `null` resets to the default `true`), `ab_min_sample_size` (integer | null — deliveries the leading variant must reach before an automatic verdict, 10–1,000,000, `null` resets to the default 30), and `ab_confidence_threshold` (number | null — Bayesian posterior confidence required to promote, 0.500–0.999, `null` resets to the default 0.950). `GET /campaigns/{id}/ab-results` echoes those settings together with a live `auto_winner_progress` snapshot — the gate values the evaluator currently applies, the current leader, and whether it would already lock — so a dashboard can render real progress toward an automatic verdict. See the [A/B testing guide](/guides/campaign-ab-testing).
</Note>

### Create a campaign

<Note>
  `POST /api/v1/campaigns/`
</Note>

**Request**

```json theme={null}
{
  "name": "September win-back",
  "channel": "sms",
  "segment_id": "seg_7c4e2a9b1d3f50618293a4b5",
  "template_id": "tmpl_9e8d7c6b5a4f3021e5d6c7b8"
}
```

<ResponseExample>
  ```json 201 theme={null}
  {
    "data": {
      "id": "cmp_1a2b3c4d5e6f7081a2b3c4d5",
      "name": "September win-back",
      "status": "draft"
    },
    "meta": {
      "request_id": "req_create",
      "timestamp": "2026-08-01T12:00:00.000Z"
    }
  }
  ```
</ResponseExample>

### Check for overlapping schedules

<Note>
  `POST /api/v1/campaigns/check-schedule-conflicts`
</Note>

**Request**

```json theme={null}
{
  "scheduled_at": "2026-09-01T14:00:00.000Z",
  "channel": "sms"
}
```

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "conflicts": [],
      "scheduled_at": "2026-09-01T14:00:00.000Z"
    },
    "meta": {
      "request_id": "req_schedule",
      "timestamp": "2026-08-01T12:01:00.000Z"
    }
  }
  ```
</ResponseExample>

### Launch the campaign

<Note>
  `POST /api/v1/campaigns/{id}/send`
</Note>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "id": "cmp_1a2b3c4d5e6f7081a2b3c4d5",
      "status": "sending"
    },
    "meta": {
      "request_id": "req_launch",
      "timestamp": "2026-08-01T12:02:00.000Z"
    }
  }
  ```
</ResponseExample>

### Error envelope

```json 422 theme={null}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "status": 422,
    "message": "name: Required"
  },
  "meta": {
    "request_id": "req_...",
    "timestamp": "2026-08-01T12:00:00.000Z"
  }
}
```
