Admin

Create competition

Changed on

Create a new competition (internal). Fails with ALREADY_EXISTS if the slug is already taken.

post/admin/competitions

Request

Request body

slugstring
namestring
descriptionstring
start_timestring int64
end_timestring int64
prize_poolstring
prize_table_jsonstring
scoring_config_jsonstring
cohort_root_walletstring

cohort_root_wallet, when set, also creates this competition's cohort_flag_sources row (hex address, the referral tree's root) in the same transaction, so RefreshMaykanCohort works without a separate insert. Leave empty for a non-cohort competition.

cohort_max_depthinteger

cohort_max_depth is the referral tree depth to walk from cohort_root_wallet (0 = root only). Only meaningful, and only read, when cohort_root_wallet is set.

cohort_extra_wallets_jsonstring

cohort_extra_wallets_json is a JSON array of hex addresses added to the cohort on top of the referral tree (e.g. BD/marketing wallets). Defaults to "[]". Only meaningful, and only read, when cohort_root_wallet is set.

Response

A successful response.

prize_table_jsonstring

prize_table JSON as a string, matching GetCompetition (a "winner takes all" table is derived from prize_pool when none was configured).

scoring_config_jsonstring

scoring_config JSON as a string. Unlike GetCompetition's, this one still carries registration_code — this service is internal-only, and echoing it is how an admin reads back the code they just set.

Changes