Admin - Campaigns

Update a campaign (admin only). `slug` is immutable.

patch/api/admin/campaigns/{id}

Request

  • Base URL
    https://api.rewritelifestyle.ai (the document declares no server; this is the origin it was published from)
  • URL
    https://api.rewritelifestyle.ai/api/admin/campaigns/{id}
  • Auth
    HTTP bearer

Path parameters

idnumber required

Request body

namestring
template'offer_sheet_v1'
placement'home_bottom_sheet' | 'paywall' | 'subscription_tab'
start_atstring
end_atstring
is_activeboolean
prioritynumber

Higher wins when several campaigns match

dismissibleboolean
cooldown_hoursobject

Hours to wait after a shown event before showing again. Null = no cooldown.

max_impressionsobject

Total shown events per user before the campaign stops appearing.

claimableboolean

Whether POST /campaigns/:id/claim is accepted

max_claimsobject

Global stock cap. Null = unlimited.

suppress_after_claimboolean
requires_addressboolean

Whether claiming requires a shipping address. Only for campaigns that ship a physical item — the address is stored separately and deleted after fulfilment.

eligibility_rule'none' | 'subscription_transition'

Extra gate on claiming, beyond variant audience targeting. Omit or use none for no gate.

eligibility_rule_paramsobject

Parameters for eligibility_rule. For subscription_transition: { transition_types: string[] (from GET /campaigns/eligibility-transition-types), since: "campaign_start" | "last_n_days", window_days?: number, extension_reasons?: string[] }

countriesstring[]

ISO-3166-1 alpha-2. Empty = anywhere.

allowed_user_idsstring[]

Restrict the campaign to these user ids, on top of every other filter — a listed user still has to pass countries and still has to match a variant audience. Omit or send an empty array for no restriction. For internal testing and one-off cohorts; ids differ between environments.

excluded_statesstring[]

Excluded subdivisions, matched against profile.state — which nothing currently populates, so this filter is inert today. Restrict via countries instead.

Example request

{
  "name": "Smart Scale Giveaway",
  "start_at": "2026-09-01T00:00:00.000Z",
  "end_at": "2026-09-14T23:59:59.000Z",
  "countries": [
    "US"
  ],
  "allowed_user_ids": [
    90,
    91
  ],
  "excluded_states": [
    "QC"
  ]
}

Changes

No recorded changes to this operation across all 34 revisions of this API.