# Send or schedule campaign (/api-reference/campaigns/sendCampaign)

`POST /campaigns/{id}/send`

Base URL: `https://next-api.useplunk.com`

Send a campaign immediately or schedule it for future delivery.

## Path parameters

- `id`: string (uuid) (required)

## Request body

- `scheduledFor`: string (date-time) — Timestamp for when to send the campaign. Omit or set to null for immediate send. Any value `new Date()` can parse is accepted; an unparseable one returns `400`.

Example:

```json
{
  "scheduledFor": "2026-08-09T17:56:20.150Z"
}
```

## Responses

### `200` — Campaign scheduled or sending

- `success`: boolean
- `data`: object
  - `id`: string
  - `name`: string
  - `description`: string
  - `subject`: string
  - `body`: string
  - `from`: string (email)
  - `fromName`: string
  - `replyTo`: string (email)
  - `type`: enum ("TRANSACTIONAL" | "MARKETING" | "HEADLESS") — Content type of the campaign email. Not to be confused with `audienceType`.
  - `status`: enum ("DRAFT" | "SCHEDULED" | "SENDING" | "SENT" | "CANCELLED")
  - `audienceType`: enum ("ALL" | "SEGMENT" | "FILTERED")
  - `audienceCondition`: object — Set when `audienceType` is `FILTERED`.
  - `segmentId`: string — Set when `audienceType` is `SEGMENT`.
  - `scheduledFor`: string (date-time) — When the campaign is scheduled to send. Null for immediate or unsent campaigns.
  - `totalRecipients`: integer
  - `sentCount`: integer
  - `deliveredCount`: integer
  - `openedCount`: integer
  - `clickedCount`: integer
  - `bouncedCount`: integer
  - `projectId`: string
  - `sentAt`: string (date-time)
  - `createdAt`: string (date-time)
  - `updatedAt`: string (date-time)
- `message`: string — Human-readable confirmation, e.g. `Campaign is being sent`.

```json
{
  "success": false,
  "data": {
    "id": "string",
    "name": "string",
    "description": "string",
    "subject": "string",
    "body": "string",
    "from": "user@example.com",
    "fromName": "string",
    "replyTo": "user@example.com",
    "type": "TRANSACTIONAL",
    "status": "DRAFT",
    "audienceType": "ALL",
    "audienceCondition": {
      "logic": "AND",
      "groups": [
        {
          "filters": [
            {
              "field": "string",
              "operator": "equals"
            }
          ]
        }
      ]
    },
    "segmentId": "string",
    "scheduledFor": "2026-08-09T17:56:20.150Z",
    "totalRecipients": 0,
    "sentCount": 0,
    "deliveredCount": 0,
    "openedCount": 0,
    "clickedCount": 0,
    "bouncedCount": 0,
    "projectId": "string",
    "sentAt": "2026-08-09T17:56:20.150Z",
    "createdAt": "2026-08-09T17:56:20.150Z",
    "updatedAt": "2026-08-09T17:56:20.150Z"
  },
  "message": "string"
}
```

### `400` — Unparseable `scheduledFor`, or the campaign is not in a sendable state.

- `success`: enum (false)
- `error`: object
  - `code`: string — Machine-readable error code, e.g. `VALIDATION_ERROR`, `INVALID_API_KEY`, `IDEMPOTENCY_KEY_REUSED`.
  - `message`: string
  - `statusCode`: integer
  - `requestId`: string — Correlation ID for this request. Include it when contacting support.
  - `errors`: array<object> — Field-level detail, present on validation failures.
    items:
      - `field`: string — Dot-path of the offending field, e.g. `attachments.0.filename`.
      - `message`: string
      - `code`: string — Validation issue code, e.g. `invalid_type`, `too_big`, `reserved_event`.
      - `received`: object — The value that was received, when available.
  - `details`: object — Additional error context.
  - `suggestion`: string — Hint for fixing the request.
- `timestamp`: string (date-time)

```json
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "statusCode": 0,
    "requestId": "string",
    "errors": [
      {
        "field": "string",
        "message": "string",
        "code": "string",
        "received": null
      }
    ],
    "details": null,
    "suggestion": "string"
  },
  "timestamp": "2026-08-09T17:56:20.150Z"
}
```

### `401` — Missing or invalid API key.

- `success`: enum (false)
- `error`: object
  - `code`: string — Machine-readable error code, e.g. `VALIDATION_ERROR`, `INVALID_API_KEY`, `IDEMPOTENCY_KEY_REUSED`.
  - `message`: string
  - `statusCode`: integer
  - `requestId`: string — Correlation ID for this request. Include it when contacting support.
  - `errors`: array<object> — Field-level detail, present on validation failures.
    items:
      - `field`: string — Dot-path of the offending field, e.g. `attachments.0.filename`.
      - `message`: string
      - `code`: string — Validation issue code, e.g. `invalid_type`, `too_big`, `reserved_event`.
      - `received`: object — The value that was received, when available.
  - `details`: object — Additional error context.
  - `suggestion`: string — Hint for fixing the request.
- `timestamp`: string (date-time)

```json
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "statusCode": 0,
    "requestId": "string",
    "errors": [
      {
        "field": "string",
        "message": "string",
        "code": "string",
        "received": null
      }
    ],
    "details": null,
    "suggestion": "string"
  },
  "timestamp": "2026-08-09T17:56:20.150Z"
}
```

### `404` — The requested resource does not exist in this project.

- `success`: enum (false)
- `error`: object
  - `code`: string — Machine-readable error code, e.g. `VALIDATION_ERROR`, `INVALID_API_KEY`, `IDEMPOTENCY_KEY_REUSED`.
  - `message`: string
  - `statusCode`: integer
  - `requestId`: string — Correlation ID for this request. Include it when contacting support.
  - `errors`: array<object> — Field-level detail, present on validation failures.
    items:
      - `field`: string — Dot-path of the offending field, e.g. `attachments.0.filename`.
      - `message`: string
      - `code`: string — Validation issue code, e.g. `invalid_type`, `too_big`, `reserved_event`.
      - `received`: object — The value that was received, when available.
  - `details`: object — Additional error context.
  - `suggestion`: string — Hint for fixing the request.
- `timestamp`: string (date-time)

```json
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "statusCode": 0,
    "requestId": "string",
    "errors": [
      {
        "field": "string",
        "message": "string",
        "code": "string",
        "received": null
      }
    ],
    "details": null,
    "suggestion": "string"
  },
  "timestamp": "2026-08-09T17:56:20.150Z"
}
```

### `422` — The campaign `id` in the path is not a valid UUID.

- `success`: enum (false)
- `error`: object
  - `code`: string — Machine-readable error code, e.g. `VALIDATION_ERROR`, `INVALID_API_KEY`, `IDEMPOTENCY_KEY_REUSED`.
  - `message`: string
  - `statusCode`: integer
  - `requestId`: string — Correlation ID for this request. Include it when contacting support.
  - `errors`: array<object> — Field-level detail, present on validation failures.
    items:
      - `field`: string — Dot-path of the offending field, e.g. `attachments.0.filename`.
      - `message`: string
      - `code`: string — Validation issue code, e.g. `invalid_type`, `too_big`, `reserved_event`.
      - `received`: object — The value that was received, when available.
  - `details`: object — Additional error context.
  - `suggestion`: string — Hint for fixing the request.
- `timestamp`: string (date-time)

```json
{
  "success": false,
  "error": {
    "code": "string",
    "message": "string",
    "statusCode": 0,
    "requestId": "string",
    "errors": [
      {
        "field": "string",
        "message": "string",
        "code": "string",
        "received": null
      }
    ],
    "details": null,
    "suggestion": "string"
  },
  "timestamp": "2026-08-09T17:56:20.150Z"
}
```

## Example request

```bash
curl -X POST 'https://next-api.useplunk.com/campaigns/{id}/send' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"scheduledFor":"2026-08-09T17:56:20.150Z"}'
```
