Docs
Open dashboard

Create campaign

POST/campaigns

Creates a campaign with its recipients. Recipients are loaded at creation via recipients[]; they are managed in the app afterwards. **Resulting status.** With recipients present, a scheduled campaign lands in scheduled and an immediate one in ready; with no recipients it lands in draft. An immediate campaign is dispatched to the voice provider straight away — unless business hours are enabled and the current time falls outside them, which is rejected with 422 rather than left silently waiting. A campaign sitting in ready is started from the app. Send channel: "sms" with an SmsCampaignCreate body to create an SMS campaign instead. **Idempotency.** A repeat POST matching an existing campaign on (workspace, agent, name) within 30 seconds returns the existing campaign instead of creating a second one.

Requires Authorization: Bearer <api_key>. Create a key in the Inspra dashboard under Workspace Settings → API Keys.

Body application/json

Response 201 Created

Campaign created. The body is a Campaign, plus the two create-only diagnostics _import (recipient load result) and _autoStart (whether provider dispatch has begun). An immediate campaign lands in ready and flips to active once dispatch succeeds.

Errors

  • 400Bad Request
    Validation failed / malformed request.
  • 401Unauthorized
    Missing, malformed, or invalid API key.
  • 403Forbidden
    Workspace unavailable, suspended, or paywalled.
  • 409Conflict
    Request conflicts with current resource state.
  • 429Too Many Requests
    Workspace request limit exceeded; shared across all its API keys.