{
  "method": "POST",
  "path": "/v1/leagues",
  "note": "Replace <weekly_xp program id> with the id of program weekly_xp (GET /v1/programs?limit=100, the item whose key is weekly_xp). Then POST /v1/leagues/{id}/activate with {\"expected_revision\": 1}.",
  "body": {
    "key": "weekly_league",
    "name": "Weekly league",
    "config": {
      "schema": "league/v1",
      "tiers": [
        {
          "key": "bronze",
          "name": "Bronze",
          "promote_count": 5,
          "demote_count": 0,
          "rewards": [
            {
              "rank_from": 1,
              "rank_to": 3,
              "currency": "coins",
              "amount": 50
            }
          ]
        },
        {
          "key": "silver",
          "name": "Silver",
          "promote_count": 5,
          "demote_count": 5,
          "rewards": [
            {
              "rank_from": 1,
              "rank_to": 3,
              "currency": "coins",
              "amount": 100
            }
          ]
        },
        {
          "key": "gold",
          "name": "Gold",
          "promote_count": 0,
          "demote_count": 5,
          "rewards": [
            {
              "rank_from": 1,
              "rank_to": 3,
              "currency": "coins",
              "amount": 200
            }
          ]
        }
      ],
      "cohort_size": 30,
      "period": {
        "kind": "week",
        "start_weekday": 1,
        "start_minute": 0,
        "timezone": "environment"
      },
      "score": {
        "source": "leaderboard",
        "program_id": "<weekly_xp program id>"
      },
      "matching": "none",
      "settle_delay_minutes": 10,
      "min_score_to_promote": 1
    }
  },
  "activate": {
    "method": "POST",
    "path": "/v1/leagues/{id}/activate",
    "body": {
      "expected_revision": 1
    }
  }
}
