← All routes

Competitions

/comp

Public competition-facing API for reading competition data, entries, league tables, and match details. The legacy admin functions live under /comp/admin and are not part of the root competition API.

Endpoints

GET/comp

List all competition records.

Query params: none

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp

Example response:

{"data":[{"comp_id":1,"comp_num":23,"comp_code":"WCC","comp_name":"World Club Cup","entries_open":"Y","active":"Y","day":1}]}
GET/comp/:compNum

Fetch a single competition by its legacy comp_num value.

Query params: compNum (required)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/23

Example response:

{"data":{"comp_id":1,"comp_num":23,"comp_code":"WCC","comp_name":"World Club Cup","entries_open":"Y","active":"Y","day":1}}
GET/comp/:compNum/entry-state

Read the current entry state and the associated season settings.

Query params: season (optional)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/23/entry-state?season=46

Example response:

{"data":{"comp_num":23,"entries_open":"Y","open":true,"season":46,"settings":[...]}}
PATCH/comp/:compNum/entry-state

Set whether entries are currently open. Accepts entries_open or open.

Body: entries_open ("Y"|"N"|boolean, required)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/23/entry-state

Example response:

{"data":{"comp_num":23,"entries_open":"Y","open":true,"updated":true}}
POST/comp/addentry

Add a team entry to a competition and season ahead of the competition start. This is a public competition-entry action, not an admin-only task.

Body: comp_num, season_num, team_id, manager_id, team_name (optional)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/addentry

Example response:

{"data":{"comp_num":23,"season_num":46,"team_id":2,"manager_id":123,"inserted_id":456}}
GET/comp/:compNum/league

Fetch the league table for a given season and competition.

Query params: season (required, defaults to 46)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/23/league?season=46

Example response:

{"data":{"comp_num":23,"season_num":46,"count":14,"teams":[{"team_id":2,"team_name":"Chiefs","level_num":1,"points":12,"pfor":123,"pagainst":89}]}}
GET/comp/:compNum/levels

Fetch the level definitions for a given season and comp.

Query params: season (required, defaults to 46)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/23/levels?season=46

Example response:

{"data":{"comp_num":23,"season_num":46,"count":3,"levels":[{"level_num":1,"level_name":"Premiership","count":14}]}}
GET/comp/:compNum/seasons

List distinct seasons in which the competition has levels defined.

Query params: none

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/23/seasons

Example response:

{"data":{"comp_num":23,"count":3,"seasons":[{"season_num":46},{"season_num":45}]}}
GET/comp/getnewlevels

Preview the automatically generated level split for a competition season based on current entries.

Query params: comp_num or compNum (required), season_num or seasonNum (optional, defaults to 46)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/getnewlevels?comp_num=23&season_num=46

Example response:

{"data":{"comp_num":23,"season_num":46,"total_teams":16,"levels":[{"level_num":1,"level_name":"Level 1","count":8},{"level_num":2,"level_name":"Level 2","count":8}]}}
POST/comp/allocateteams

Allocate the current season entries into balanced level groups and insert them into comp_teams.

Body: comp_num, season_num

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/allocateteams

Example response:

{"data":{"comp_num":23,"season_num":46,"inserted_count":16,"levels":[{"level_num":1,"count":8}]}}
GET/comp/admin

List the available legacy admin routes for managing competitions and match data.

Query params: none

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin

Example response:

{"data":{"source":"legacy-comp-admin","routes":["getdata","getcompfixtures","getmatchsummary","getreportersummaries","loadround","savematchdata","competitions","entry-state","levels","teams","settings"]}}
GET/comp/admin/getdata

Legacy admin data proxy for direct Blackout Rugby API lookups using a raw legacy page string.

Query params: page (required, e.g. "r=ms&fixtureids=123")

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/getdata?page=r%3Dms%26fixtureids%3D123

Example response:

{"data":{"status":"Ok","fixtures":[...]}}
GET/comp/admin/getcompfixtures

Return the fixtures for a competition, season, and round in the same shape the legacy admin script expects.

Query params: comp_num or c (required), season_num or s (required), round_num or r (optional, defaults to 1)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/getcompfixtures?comp_num=23&season_num=46&round_num=1

Example response:

{"data":{"comp_num":23,"season_num":46,"round_num":1,"count":4,"fixtures":[...]}}
GET/comp/admin/getmatchsummary

Return the match summaries for a given competition round.

Query params: comp_num or c (required), season_num or s (required), round_num or r (optional, defaults to 1)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/getmatchsummary?comp_num=23&season_num=46&round_num=1

Example response:

{"data":{"comp_num":23,"season_num":46,"round_num":1,"count":4,"fixtures":[...]}}
GET/comp/admin/getreportersummaries

Return the reporter summary data associated with a competition round.

Query params: comp_num or c (required), season_num or s (required), round_num or r (optional, defaults to 1)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/getreportersummaries?comp_num=23&season_num=46&round_num=1

Example response:

{"data":{"comp_num":23,"season_num":46,"round_num":1,"count":4,"summaries":[...]}}
GET/comp/admin/load

Legacy compatibility route for loading round results in the old admin/test.php style. Accepts c, s, and r query params.

Query params: c or comp_num (required), s or season_num (required), r or round_num (optional, defaults to 1)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/load?c=23&s=62&r=2

Example response:

{"data":{"comp_num":23,"season_num":62,"round_num":2,"count":4,"fixtures":[...]}}
GET/comp/admin/loadresults

Explicit alias for the legacy round-load workflow; same behavior as /comp/admin/load.

Query params: c or comp_num (required), s or season_num (required), r or round_num (optional, defaults to 1)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/loadresults?c=23&s=62&r=2

Example response:

{"data":{"comp_num":23,"season_num":62,"round_num":2,"count":4,"fixtures":[...]}}
GET/comp/admin/loadround

Load fixture data for a competition round in the same style as the legacy admin loader.

Query params: comp_num or c (required), season_num or s (required), round_num or r (optional, defaults to 1)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/loadround?comp_num=23&season_num=46&round_num=1

Example response:

{"data":{"comp_num":23,"season_num":46,"round_num":1,"count":4,"fixtures":[...]}}
POST/comp/admin/savematchdata

Persist admin-updated match result rows into comp_result.

Body: results: [{comp_num, season_num, round_num, home_id, guest_id, home_score, guest_score, fixture_id}]

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/savematchdata

Example response:

{"data":{"saved_count":1,"saved":[{"result_id":123,"updated":false}]}}
GET/comp/admin/competitions

Return all competition metadata rows from the comp_info table for admin workflows.

Query params: none

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/competitions

Example response:

{"data":{"count":2,"competitions":[{"comp_num":23,"comp_name":"World Club Cup","entries_open":"Y","active":"Y"}]}}
PATCH/comp/admin/competitions/:compNum

Update admin-editable competition metadata such as name, code, active state, or entries_open.

Body: comp_name, comp_code, entries_open, active, season, introduction

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/competitions/23

Example response:

{"data":{"comp_num":23,"comp_name":"World Club Cup","entries_open":"Y","active":"Y"}}
GET/comp/admin/levels

Admin list of level setup rows for a given competition and season.

Query params: comp_num or compNum (required), season_num or seasonNum (optional, defaults to 46)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/levels?comp_num=23&season_num=46

Example response:

{"data":{"comp_num":23,"season_num":46,"count":3,"levels":[{"level_num":1,"level_name":"Premiership","count":14}]}}
POST/comp/admin/levels

Create or update a level definition for a competition season.

Body: comp_num, season_num, level_num, level_name, count

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/levels

Example response:

{"data":{"created":true,"level":{"comp_num":23,"season_num":46,"level_num":1,"level_name":"Premiership","count":14}}}
GET/comp/admin/teams

Admin list of teams registered against a competition and season.

Query params: comp_num or compNum (required), season_num or seasonNum (optional, defaults to 46)

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/teams?comp_num=23&season_num=46

Example response:

{"data":{"comp_num":23,"season_num":46,"count":12,"teams":[{"team_id":2,"team_name":"Chiefs","level_num":1}]}}
POST/comp/admin/teams

Create or update a team entry in a competition season.

Body: comp_num, season_num, team_id, team_name, level_num, stars, ranking, nation

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/teams

Example response:

{"data":{"created":true,"team":{"comp_num":23,"season_num":46,"team_id":2,"team_name":"Chiefs","level_num":1,"stars":0,"ranking":0,"nation":"ZA"}}}
GET/comp/admin/settings

Read the comp_settings table used for admin configuration values.

Query params: none

Blackout Rugby API call: https://blackoutrugby.magicrunez.com/comp/admin/settings

Example response:

{"data":{"count":3,"settings":[{"keyname":"entries_open","value":"Y"}]}}