<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://war.app/index.php?action=history&amp;feed=atom&amp;title=Public_Tournament_API</id>
	<title>Public Tournament API - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://war.app/index.php?action=history&amp;feed=atom&amp;title=Public_Tournament_API"/>
	<link rel="alternate" type="text/html" href="https://war.app/wiki/index.php?title=Public_Tournament_API&amp;action=history"/>
	<updated>2026-11-04T15:05:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://war.app/wiki/index.php?title=Public_Tournament_API&amp;diff=8042&amp;oldid=prev</id>
		<title>Fizzer: Created page with &quot;War.app has two APIs for public tournaments: * &#039;&#039;&#039;CreatePublicTournament&#039;&#039;&#039; creates a public tournament. * &#039;&#039;&#039;ForwardPublicTournamentInvites&#039;&#039;&#039; invites players to a public tournament you created.  Together, they let a program run its own tournament series. For example, a program could create a tournament each week and invite everyone on a list.  Like the Create game API, these APIs are restricted to War.app members, and only work with your API token....&quot;</title>
		<link rel="alternate" type="text/html" href="https://war.app/wiki/index.php?title=Public_Tournament_API&amp;diff=8042&amp;oldid=prev"/>
		<updated>2026-11-02T10:39:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;War.app has two APIs for public tournaments: * &amp;#039;&amp;#039;&amp;#039;CreatePublicTournament&amp;#039;&amp;#039;&amp;#039; creates a public tournament. * &amp;#039;&amp;#039;&amp;#039;ForwardPublicTournamentInvites&amp;#039;&amp;#039;&amp;#039; invites players to a public tournament you created.  Together, they let a program run its own tournament series. For example, a program could create a tournament each week and invite everyone on a list.  Like the &lt;a href=&quot;/wiki/Create_game_API&quot; title=&quot;Create game API&quot;&gt;Create game API&lt;/a&gt;, these APIs are restricted to War.app &lt;a href=&quot;/wiki/Membership&quot; title=&quot;Membership&quot;&gt;members&lt;/a&gt;, and only work with your API token....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;War.app has two APIs for public tournaments:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CreatePublicTournament&amp;#039;&amp;#039;&amp;#039; creates a public tournament.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ForwardPublicTournamentInvites&amp;#039;&amp;#039;&amp;#039; invites players to a public tournament you created.&lt;br /&gt;
&lt;br /&gt;
Together, they let a program run its own tournament series. For example, a program could create a tournament each week and invite everyone on a list.&lt;br /&gt;
&lt;br /&gt;
Like the [[Create game API]], these APIs are restricted to War.app [[Membership|members]], and only work with your API token.&lt;br /&gt;
&lt;br /&gt;
They only work with public tournaments, which appear on the Open Tournaments list for anyone to join. Private tournaments aren&amp;#039;t supported. The APIs enforce the same rules as the tournament creation pages on the website. Anything they create could also have been created there.&lt;br /&gt;
&lt;br /&gt;
==Calling the APIs==&lt;br /&gt;
&lt;br /&gt;
To call either API, POST JSON to its URL. Every request needs these two fields:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;hostEmail&amp;#039;&amp;#039;&amp;#039; / &amp;#039;&amp;#039;&amp;#039;hostAPIToken&amp;#039;&amp;#039;&amp;#039;: these identify you. You can get your API token from the [[Get API Token API]].&lt;br /&gt;
&lt;br /&gt;
Every response is a JSON object with a &amp;#039;&amp;#039;&amp;#039;termsOfUse&amp;#039;&amp;#039;&amp;#039; field. If the call fails, the response also has an &amp;#039;&amp;#039;&amp;#039;error&amp;#039;&amp;#039;&amp;#039; field describing what went wrong. That&amp;#039;s either a message, or the name of an error such as &amp;lt;code&amp;gt;InsufficientCoins&amp;lt;/code&amp;gt;. For example:&lt;br /&gt;
&lt;br /&gt;
  {&lt;br /&gt;
      &amp;quot;termsOfUse&amp;quot;: &amp;quot;Please use this API responsibly, ...&amp;quot;,&lt;br /&gt;
      &amp;quot;error&amp;quot;: &amp;quot;Public tournaments must be at least 8 players&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
When a call fails, nothing is changed.&lt;br /&gt;
&lt;br /&gt;
==CreatePublicTournament==&lt;br /&gt;
&lt;br /&gt;
POST to https://www.war.app/API/CreatePublicTournament. You&amp;#039;ll be the tournament&amp;#039;s creator, exactly as if you&amp;#039;d created it through the UI. You pay its creation cost in coins (see [[#Coins|Coins]]).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;hostEmail&amp;quot;: &amp;quot;your@email.com&amp;quot;,&lt;br /&gt;
    &amp;quot;hostAPIToken&amp;quot;: &amp;quot;yourApiToken&amp;quot;,&lt;br /&gt;
    &amp;quot;tournamentName&amp;quot;: &amp;quot;Weekly 1v1 (max 50 chars)&amp;quot;,&lt;br /&gt;
    &amp;quot;description&amp;quot;: &amp;quot;Shown on the tournament&amp;#039;s page&amp;quot;,&lt;br /&gt;
    &amp;quot;templateID&amp;quot;: 1234,&lt;br /&gt;
    &amp;quot;type&amp;quot;: &amp;quot;SingleElimination&amp;quot;,&lt;br /&gt;
    &amp;quot;teamSize&amp;quot;: 1,&lt;br /&gt;
    &amp;quot;teamsPerGame&amp;quot;: 2,&lt;br /&gt;
    &amp;quot;numberOfRounds&amp;quot;: 4,&lt;br /&gt;
    &amp;quot;canForwardInvites&amp;quot;: true,&lt;br /&gt;
    &amp;quot;entryFee&amp;quot;: 10,&lt;br /&gt;
    &amp;quot;extraCoins&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;startInMinutes&amp;quot;: 60,&lt;br /&gt;
    &amp;quot;settings&amp;quot;: { ... }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| tournamentName || Yes || The tournament&amp;#039;s name. Maximum 50 characters.&lt;br /&gt;
|-&lt;br /&gt;
| description || No || The tournament&amp;#039;s description. It&amp;#039;s the same as the PersonalMessage setting. If you also give PersonalMessage in &amp;#039;&amp;#039;&amp;#039;settings&amp;#039;&amp;#039;&amp;#039;, that&amp;#039;s used instead.&lt;br /&gt;
|-&lt;br /&gt;
| templateID || No || The ID of the template whose settings the tournament&amp;#039;s games use. If you leave it out, the &amp;quot;Normal Game&amp;quot; template is used.&lt;br /&gt;
|-&lt;br /&gt;
| settings || No || Settings that override the template&amp;#039;s, the same way as in the [[Create game API]]. To see a full list of settings, use the [[Query game API]] with GetSettings=true.&lt;br /&gt;
|-&lt;br /&gt;
| type || Yes || &amp;lt;code&amp;gt;SingleElimination&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;DoubleElimination&amp;lt;/code&amp;gt;. Public tournaments can&amp;#039;t be round robin.&lt;br /&gt;
|-&lt;br /&gt;
| teamSize || Yes || How many players are on each team. Use 1 for a tournament without teams.&lt;br /&gt;
|-&lt;br /&gt;
| teamsPerGame || Only for SingleElimination || How many teams play in each game. Double elimination games always have 2 teams, so this is ignored for DoubleElimination.&lt;br /&gt;
|-&lt;br /&gt;
| numberOfRounds || Yes || How many rounds the tournament has, at least 2. The number of players is teamsPerGame to the power of numberOfRounds, times teamSize. For example, 4 rounds of 1v1 is 2&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt; × 1 = 16 players.&lt;br /&gt;
|-&lt;br /&gt;
| canForwardInvites || Yes || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to let players in the tournament invite others.&lt;br /&gt;
|-&lt;br /&gt;
| entryFee || No || The coins each player pays to join, from 0 to 2,000. Defaults to 0.&lt;br /&gt;
|-&lt;br /&gt;
| extraCoins || No || Coins you add to the prizes, from 0 to 50,000. Defaults to 0.&lt;br /&gt;
|-&lt;br /&gt;
| startInMinutes || Yes || How many minutes from now the tournament starts. See [[#Start time|Start time]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, the response includes the new tournament&amp;#039;s ID, as a string:&lt;br /&gt;
&lt;br /&gt;
  {&lt;br /&gt;
      &amp;quot;termsOfUse&amp;quot;: &amp;quot;...&amp;quot;,&lt;br /&gt;
      &amp;quot;tournamentID&amp;quot;: &amp;quot;123456&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
When the tournament is created, it&amp;#039;s also announced in the global chat, the same as when you create one on the website.&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
&lt;br /&gt;
The tournament must meet the same requirements as on the website&amp;#039;s tournament creation page:&lt;br /&gt;
* You must have unlocked tournaments.&lt;br /&gt;
* It must have between 8 and 512 players.&lt;br /&gt;
* Each game can have at most 40 players (teamSize × teamsPerGame).&lt;br /&gt;
* The template and settings must be valid for a tournament on the map they use. For example, the map must be public, and must be big enough for each game&amp;#039;s players.&lt;br /&gt;
* In real-time tournaments, the boot time must be at least 2 minutes.&lt;br /&gt;
&lt;br /&gt;
===Boot times===&lt;br /&gt;
&lt;br /&gt;
Tournaments have one boot time, like on the website&amp;#039;s boot time step. The tournament uses the direct boot time from the template or settings:&lt;br /&gt;
* The auto boot time is set to the same value.&lt;br /&gt;
* If the initial bank is used, the banking boot time is set to 0. Otherwise, it isn&amp;#039;t used.&lt;br /&gt;
You don&amp;#039;t need to give the auto boot or banking boot times. Any values you give for them are replaced.&lt;br /&gt;
&lt;br /&gt;
===Start time===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;startInMinutes&amp;#039;&amp;#039;&amp;#039; must be:&lt;br /&gt;
* For real-time tournaments: at least 1, and at most 120.&lt;br /&gt;
* For multi-day tournaments: at least 5, and at most 1440 (one day).&lt;br /&gt;
&lt;br /&gt;
===Coins===&lt;br /&gt;
&lt;br /&gt;
Public tournaments are always coin tournaments. You pay a creation cost when the tournament is created. If you don&amp;#039;t have enough coins, the call fails with &amp;lt;code&amp;gt;InsufficientCoins&amp;lt;/code&amp;gt;. The cost is the same as on the website. It&amp;#039;s currently:&lt;br /&gt;
* the entry fee, plus&lt;br /&gt;
* the number of players divided by 4, rounded up, plus&lt;br /&gt;
* the extra coins, plus&lt;br /&gt;
* 3 more coins if the entry fee is 0.&lt;br /&gt;
&lt;br /&gt;
The prizes are worked out the same way as for tournaments created on the website.&lt;br /&gt;
&lt;br /&gt;
==ForwardPublicTournamentInvites==&lt;br /&gt;
&lt;br /&gt;
POST to https://www.war.app/API/ForwardPublicTournamentInvites to invite players to a public tournament. Each invited player gets a notification, as when you invite someone from the tournament&amp;#039;s page.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
  {&lt;br /&gt;
    &amp;quot;hostEmail&amp;quot;: &amp;quot;your@email.com&amp;quot;,&lt;br /&gt;
    &amp;quot;hostAPIToken&amp;quot;: &amp;quot;yourApiToken&amp;quot;,&lt;br /&gt;
    &amp;quot;tournamentID&amp;quot;: 123456,&lt;br /&gt;
    &amp;quot;players&amp;quot;: [ &amp;quot;66553413&amp;quot;, &amp;quot;134314314&amp;quot;, &amp;quot;someone@example.com&amp;quot; ]&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| tournamentID || Yes || The ID of the tournament, such as one returned by CreatePublicTournament.&lt;br /&gt;
|-&lt;br /&gt;
| players || Yes || The players to invite. Each is either an invite token or the e-mail address of a War.app account. Players can find their invite token at https://www.war.app/InviteToken; it&amp;#039;s also the number in the address bar when you view a player&amp;#039;s profile. You can invite 1 to 100 players per call.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
On success, the response says how many players the request named:&lt;br /&gt;
&lt;br /&gt;
  {&lt;br /&gt;
      &amp;quot;termsOfUse&amp;quot;: &amp;quot;...&amp;quot;,&lt;br /&gt;
      &amp;quot;success&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
      &amp;quot;invited&amp;quot;: 3&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
If the same player appears twice, such as by both their invite token and their e-mail address, they&amp;#039;re only counted once. Players who are already in the tournament aren&amp;#039;t invited again, but they are counted.&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
&lt;br /&gt;
* You must be the tournament&amp;#039;s creator. This works even if the tournament doesn&amp;#039;t let players forward invites (see &amp;#039;&amp;#039;&amp;#039;canForwardInvites&amp;#039;&amp;#039;&amp;#039; above).&lt;br /&gt;
* The tournament must be public, and mustn&amp;#039;t have started yet.&lt;br /&gt;
* Every player must have unlocked tournaments. Open seats and AI players can&amp;#039;t be used.&lt;br /&gt;
* You can&amp;#039;t invite a player who has you on their block list.&lt;br /&gt;
* The total number of players invited to a tournament is limited to 13 times its number of players, up to 2,000. The call fails with &amp;lt;code&amp;gt;TooManyPlayersInvitedToTournament&amp;lt;/code&amp;gt; if it would go over.&lt;br /&gt;
&lt;br /&gt;
If any player in the list can&amp;#039;t be invited, the call fails and nobody from the list is invited. In most cases, the error says which player caused it.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[API]]&lt;br /&gt;
* [[Create game API]]&lt;br /&gt;
* [[Get API Token API]]&lt;br /&gt;
* [[Validate invite token API]]&lt;br /&gt;
&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Fizzer</name></author>
	</entry>
</feed>