Create a challenge Coming soon
POST/v1/challenges
Creates a draft. Start from a template and copy its fields if you like.
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
Request body#
namestringGuest-facing name.descriptionstringGuest-facing text.image_urlstring (uri)NullableHTTPS image.typestringChallenge type.One ofvisits,streak,spend,menu_discoverygoalobjectTarget and unit. The unit must match the type.Show attributesHide attributes
targetintegerunitstringOne ofvisits,periods,cents,itemsperiodstringNullableOne ofday,weekgrace_periodsintegerNullableitem_setarray of object
qualifyingobjectDefaults: no minimum, no limits,max_counted_per_day: 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 objectFixed or rolling.enrollmentstringautomaticoropt_in.One ofautomatic,opt_inrewardobject or objectPoints or a catalog reward.max_completions_per_memberintegerDefault 1.budgetobjectmax_completions.Show attributesHide attributes
max_completionsintegerNullable
Response fields#
Returns 201 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#
400Bad request
missing_param
A required field is missing.
400Bad request
invalid_param
For example a unit that doesn't match the type, or ends_at before starts_at.
404Not found
reward_not_found
reward.reward_id isn't in your catalog.
403Forbidden
missing_scope
The key doesn't have challenges:write.
Any endpoint can also return the common errors.