Publish a challenge Coming soon
POST/v1/challenges/{id}/publish
Moves a draft to scheduled if its window starts in the future, or to live now. An automatic challenge enrolls its members when it goes live. Also moves a paused challenge back to live. Run a preview first.
Returns the challenge with its new status.
Permissions: Secret key with challenges:write.
Guide
ChallengesRequest headers#
Idempotency-KeystringAny string up to 255 characters; use a UUID v4. Kept 24 hours per key (or member) and endpoint. Same key and body replays the first response withIdempotent-Replayed: true.Max Length 255
Path parameters#
idstring (uuid)Required
Response fields#
Returns 200 with Challenge
idstring (uuid)The challenge.namestringShown to guests.descriptionstringOne or two lines for guests.image_urlstring (uri)NullableHTTPS image for the challenge card.typestringvisits,streak,spendormenu_discovery.One ofvisits,streak,spend,menu_discoverygoalobjecttarget(number to reach) andunit(visits,periods,centsoritems). Streaks addperiod(dayorweek) andgrace_periods. Menu discovery addsitem_set: items (pos_item_id,name) or categories (pos_category_id,name). Fields that don't apply arenullor empty.Show attributesHide attributes
targetintegerunitstringOne ofvisits,periods,cents,itemsperiodstringNullableOne ofday,weekgrace_periodsintegerNullableitem_setarray of object
qualifyingobjectWhich orders count:min_subtotal_cents,channels,location_ids,fulfillment,available_times(same shapes as reward rules; empty lists mean no limit) andmax_counted_per_day(default 1).Show attributesHide attributes
min_subtotal_centsintegerInteger cents.Min 0channelsarray of stringlocation_idsarray of string (uuid)fulfillmentarray of stringOne ofpickup,delivery,curbside,dine_inavailable_timesarray of AvailableTimeShow attributesAvailableTime
daysarray of stringShow valuesHide values
montuewedthufrisatsun
startstringLocal time, HH:MM.endstringLocal time, HH:MM.
max_counted_per_dayinteger
windowobject or object{ "kind": "fixed", "starts_at", "ends_at" }for the same dates for everyone, or{ "kind": "rolling", "days" }for a window per member that starts when they join.enrollmentstringautomaticoropt_in.One ofautomatic,opt_inrewardobject or object{ "kind": "points", "points" }for bonus points, or{ "kind": "reward", "reward_id" }for a catalog reward that lands in the wallet.max_completions_per_memberintegerUsually 1.budgetobjectmax_completionsacross all members, ornullfor no limit.Show attributesHide attributes
max_completionsintegerNullable
statusstringdraft,scheduled,live,pausedorended.One ofdraft,scheduled,live,paused,endedversionintegerGoes up each time a scheduled or live challenge is edited. Members keep the rules of the version they joined.
Error descriptions#
409Conflict
invalid_state
The challenge isn't a draft or paused, or its window has already ended.
Any endpoint can also return the common errors.