Skip to content

Campaigns — Actions

Actions define what a campaign does to each pass in its audience. A campaign can have multiple actions that run in sort order. Actions can only be added to / reordered on draft campaigns.

Auth: Bearer token — workspace member. /campaigns/:id/actions* routes resolve the workspace from the campaign row; /campaign-actions/:id* routes resolve it by joining the action to its parent campaign.

Action Types

TypeDescription
push_notificationSend a notification to passes
template_switchSwitch passes to a different template (optionally temporary)
custom_field_updateUpdate custom field values on passes
give_rewardIssue one or more rewards
assign_tierAssign a loyalty tier (optionally temporary)

Action Config by Type

The action_config object is validated against the action type:

push_notification

FieldTypeRequiredDescription
notification_messagestringYesMessage to send

template_switch

FieldTypeRequiredDescription
target_template_idstring (UUID)YesTemplate to switch passes to
duration_daysnumber | nullNoMake the switch temporary; reverts after N days (1–3650)

custom_field_update

FieldTypeRequiredDescription
custom_field_updatesobjectYesKey-value pairs of fields to set

give_reward

FieldTypeRequiredDescription
reward_idsstring[] (UUID)YesOne or more rewards to issue

assign_tier

FieldTypeRequiredDescription
tier_idstring (UUID)YesTier to assign
duration_daysnumber | nullNoMake the assignment temporary; reverts after N days (1–3650)

Action Status

StatusDescription
pendingAction hasn't started yet
in_progressAction is currently executing
completedAction finished successfully
failedAction failed

List Campaign Actions

GET /wallethero-api/campaigns/:id/actions

Returns the campaign's actions ordered by sort, then date_created.

Auth: Bearer token — workspace member.

Path Parameters

ParameterTypeDescription
idstring (UUID)Campaign identifier

Example Request

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

Response (200)

json
{
  "data": [
    {
      "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
      "campaign_id": "CAMPAIGN_ID",
      "action_type": "push_notification",
      "action_config": { "notification_message": "Earn double points this weekend!" },
      "status": "pending",
      "sort": 0
    }
  ]
}

SDK

typescript
const actions = await wh.campaigns.getActions("CAMPAIGN_ID");

Add Campaign Action

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

Adds an action to a draft campaign. The action_config is validated against action_type.

Auth: Bearer token — workspace member.

Path Parameters

ParameterTypeDescription
idstring (UUID)Campaign identifier

Request Body

FieldTypeRequiredDescription
action_typestringYesOne of push_notification, template_switch, custom_field_update, give_reward, assign_tier
action_configobjectYesConfig for the chosen type (see Action Config by Type)
sortnumberNoPosition in the execution order

Example Request

bash
curl -X POST "https://api.wallethero.app/wallethero-api/campaigns/CAMPAIGN_ID/actions" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "action_type": "push_notification",
    "action_config": { "notification_message": "Earn double points this weekend!" }
  }'

Response (200)

json
{
  "data": {
    "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
    "campaign_id": "CAMPAIGN_ID",
    "action_type": "push_notification",
    "action_config": { "notification_message": "Earn double points this weekend!" },
    "status": "pending",
    "sort": 0
  }
}

SDK

typescript
const action = await wh.campaigns.addAction("CAMPAIGN_ID", {
  action_type: "push_notification",
  action_config: { notification_message: "Earn double points this weekend!" },
});

// Convenience helpers:
await wh.campaigns.addPushNotificationAction("CAMPAIGN_ID", "Hello!");
await wh.campaigns.addTemplateSwitchAction("CAMPAIGN_ID", "TEMPLATE_ID");
await wh.campaigns.addCustomFieldUpdateAction("CAMPAIGN_ID", { tier: "Gold" });

Reorder Campaign Actions

POST /wallethero-api/campaigns/:id/actions/reorder

Reorders a campaign's actions. action_ids must contain every action on the campaign, in the desired execution order (index 0 runs first).

Auth: Bearer token — workspace member.

Path Parameters

ParameterTypeDescription
idstring (UUID)Campaign identifier

Request Body

FieldTypeRequiredDescription
action_idsstring[] (UUID)YesAll action IDs in the new order (at least one)

Example Request

bash
curl -X POST "https://api.wallethero.app/wallethero-api/campaigns/CAMPAIGN_ID/actions/reorder" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "action_ids": ["aaaa...", "bbbb...", "cccc..."] }'

Response (200)

json
{
  "data": [
    { "id": "aaaa...", "sort": 0 },
    { "id": "bbbb...", "sort": 1 },
    { "id": "cccc...", "sort": 2 }
  ]
}

SDK

typescript
const actions = await wh.campaigns.reorderActions("CAMPAIGN_ID", [
  "aaaa...",
  "bbbb...",
  "cccc...",
]);

Update Campaign Action

PATCH /wallethero-api/campaign-actions/:id

Updates an action's config and/or sort order.

Auth: Bearer token — workspace member (resolved via the parent campaign).

Path Parameters

ParameterTypeDescription
idstring (UUID)Action identifier

Request Body

FieldTypeRequiredDescription
action_configobjectNoReplacement config (validated against the action's type)
sortnumberNoNew position in the execution order

Example Request

bash
curl -X PATCH "https://api.wallethero.app/wallethero-api/campaign-actions/ACTION_ID" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "action_config": { "notification_message": "Updated message!" } }'

Response (200)

json
{
  "data": {
    "id": "ACTION_ID",
    "action_type": "push_notification",
    "action_config": { "notification_message": "Updated message!" },
    "status": "pending"
  }
}

SDK

typescript
const action = await wh.campaigns.updateAction("ACTION_ID", {
  action_config: { notification_message: "Updated message!" },
});

Delete Campaign Action

DELETE /wallethero-api/campaign-actions/:id

Removes an action from its campaign.

Auth: Bearer token — workspace member (resolved via the parent campaign).

Path Parameters

ParameterTypeDescription
idstring (UUID)Action identifier

Example Request

bash
curl -X DELETE "https://api.wallethero.app/wallethero-api/campaign-actions/ACTION_ID" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response (200)

json
{ "success": true, "message": "Action deleted" }

SDK

typescript
await wh.campaigns.deleteAction("ACTION_ID");

Execute Single Action

POST /wallethero-api/campaign-actions/:id/execute

Executes one action immediately against the campaign's audience.

Auth: Bearer token — workspace member (resolved via the parent campaign).

Path Parameters

ParameterTypeDescription
idstring (UUID)Action identifier

Example Request

bash
curl -X POST "https://api.wallethero.app/wallethero-api/campaign-actions/ACTION_ID/execute" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response (200)

json
{
  "data": { "id": "ACTION_ID", "status": "completed", "executed_at": "2026-01-16T10:05:00Z" }
}

SDK

typescript
const action = await wh.campaigns.executeAction("ACTION_ID");

Execute All Actions

POST /wallethero-api/campaigns/:id/execute-all

Executes all pending actions on the campaign in order.

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/execute-all" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response (200)

json
{
  "data": [
    { "id": "aaaa...", "status": "completed" },
    { "id": "bbbb...", "status": "completed" }
  ]
}

SDK

typescript
const actions = await wh.campaigns.executeAllActions("CAMPAIGN_ID");

WalletHero Documentation