---
title: "Create competition"
method: POST
path: "/admin/competitions"
tags: ["Admin"]
---

# Create competition

`POST /admin/competitions`

## Request

- Base URL: `https://api.testnet.rise.trade`
- URL: `https://api.testnet.rise.trade/admin/competitions`
- Auth: none required
- TypeScript: <https://skmtc.dev/rise/apis/risex-rest-api/docs/admin/competitions/post.ts> (a function with typed inputs; its response is checked against the schema)

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

## Request body

- ApiCreateCompetitionRequest
  - `slug` string
  - `name` string
  - `description` string
  - `start_time` string, int64
  - `end_time` string, int64
  - `prize_pool` string
  - `prize_table_json` string
  - `scoring_config_json` string
  - `cohort_root_wallet` string: 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_depth` integer: 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_json` string: 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.
  - `cohort_sources` ApiCohortSourceInput[]: cohort_sources creates one cohort_flag_sources row per entry — a multi-root cohort competition in a single atomic call. May be combined with the single cohort_root_wallet fields above (kept for compatibility; they count as one more entry); roots must not repeat across the two. Every row and the competition itself are written in one transaction. More roots can still be added later via SetCohortFlagSource.
    - `root_wallet` string: root_wallet is the tree's root, as a hex address.
    - `max_depth` integer: max_depth is the referral depth to walk from root_wallet (0 = root only).
    - `extra_wallets_json` string: extra_wallets_json is a JSON array of hex addresses added on top of this tree. Defaults to "[]".

## Response `200`

A successful response.

- ApiCreateCompetitionResponse
  - `competition` ApiCompetitionMeta
    - `id` string, int64
    - `slug` string
    - `name` string
    - `description` string
    - `start_time` string, int64
    - `end_time` string, int64
    - `prize_pool` string
    - `state` string
    - `participant_count` integer
    - `created_at` string, int64: Unix seconds when the competition row was created / last updated.
    - `updated_at` string, int64
  - `prize_table_json` string: prize_table JSON as a string, matching GetCompetition (a "winner takes all" table is derived from prize_pool when none was configured).
  - `scoring_config_json` string: 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.

## Other responses

- `default`: An unexpected error response.

## Changes

- **2026-11-03** `98eabcd6a6ad`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/rise/apis/risex-rest-api/changes/admin/competitions/post.md)

---

[API](https://skmtc.dev/rise/apis/risex-rest-api.md) - [All operations](https://skmtc.dev/rise/apis/risex-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rise/apis/risex-rest-api/revisions/98eabcd6a6ad?raw)
