Skip to content

Campaigns — Lifecycle

Control when and how a campaign executes: schedule it for later, start it immediately, mark it complete, or cancel it.

Auth: Bearer token — workspace member. All routes resolve the workspace from the campaign row.

Campaign Status Flow

StatusDescription
draftInitial state. Campaign can be edited and actions added
scheduledWaiting for the scheduled time. Can be cancelled
activeCurrently executing actions. Can be cancelled
completedAll actions finished
cancelledCampaign was cancelled before completion

Schedule Campaign

POST /wallethero-api/campaigns/:id/schedule

Moves a draft campaign to scheduled and sets the time it will run.

Auth: Bearer token — workspace member.

Path Parameters

ParameterTypeDescription
idstring (UUID)Campaign identifier

Request Body

FieldTypeRequiredDescription
scheduled_atstring (ISO 8601)YesDatetime to run the campaign at

Example Request

bash
curl -X POST "https://api.wallethero.app/wallethero-api/campaigns/CAMPAIGN_ID/schedule" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "scheduled_at": "2026-01-20T09:00:00Z" }'

Response (200)

json
{
  "data": { "id": "CAMPAIGN_ID", "status": "scheduled", "scheduled_at": "2026-01-20T09:00:00Z" }
}

SDK

typescript
const campaign = await wh.campaigns.schedule("CAMPAIGN_ID", "2026-01-20T09:00:00Z");

Start Campaign Now

POST /wallethero-api/campaigns/:id/start-now

Starts the campaign immediately, bypassing any schedule. Moves it to active.

Auth: Bearer token — workspace member.

Path Parameters

ParameterTypeDescription
idstring (UUID)Campaign identifier

Example Request

bash
curl -X POST "https://api.wallethero.app/wallethero-api/campaigns/CAMPAIGN_ID/start-now" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response (200)

json
{
  "data": { "id": "CAMPAIGN_ID", "status": "active", "started_at": "2026-01-16T10:00:00Z" }
}

SDK

typescript
const campaign = await wh.campaigns.startNow("CAMPAIGN_ID");

Complete Campaign

POST /wallethero-api/campaigns/:id/complete

Marks the campaign as completed.

Auth: Bearer token — workspace member.

Path Parameters

ParameterTypeDescription
idstring (UUID)Campaign identifier

Example Request

bash
curl -X POST "https://api.wallethero.app/wallethero-api/campaigns/CAMPAIGN_ID/complete" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response (200)

json
{
  "data": { "id": "CAMPAIGN_ID", "status": "completed", "completed_at": "2026-01-16T10:15:00Z" }
}

SDK

typescript
const campaign = await wh.campaigns.complete("CAMPAIGN_ID");

Cancel Campaign

POST /wallethero-api/campaigns/:id/cancel

Cancels a scheduled or active campaign. Already-completed actions cannot be undone.

Auth: Bearer token — workspace member.

Path Parameters

ParameterTypeDescription
idstring (UUID)Campaign identifier

Example Request

bash
curl -X POST "https://api.wallethero.app/wallethero-api/campaigns/CAMPAIGN_ID/cancel" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response (200)

json
{
  "data": { "id": "CAMPAIGN_ID", "status": "cancelled" }
}

SDK

typescript
const campaign = await wh.campaigns.cancel("CAMPAIGN_ID");

WalletHero Documentation