API
Last updated: 12 Nov 2026
The Territorial.io API lets programs send Gold, create accounts, write in the lobby chat, read account data and read the clan point history over HTTP. Every API request is made with an account and costs Gold. In addition, the server publishes logs and data pages that anyone can read without an account.
1. Basics
- There are exactly 6 endpoints:
https://territorial.io/api/gold/send,https://territorial.io/api/account/get,https://territorial.io/api/account/create,https://territorial.io/api/chat/send,https://territorial.io/api/clan/stats/getandhttps://territorial.io/api/gold/seize. Only unlocked accounts can use/api/gold/seize(see 8). - Every request uses the HTTP method
POST. The request body is a JSON object. - Every response is a JSON object with the HTTP status 200. The field
statussays whether the request was successful ("ok") or which error occurred (see Status values). - The API allows requests from websites of other domains (CORS:
Access-Control-Allow-Origin: *).
1.1 Authentication
Every request contains the account name and the password of the account that makes the request. This account pays the API fees.
| Field | Type | Content |
|---|---|---|
account_name | string | The account name: 5 characters. The game shows it in the account view in the box Account Name. |
password | string | The password: 15 characters. The game shows it in the account view in the box Password. |
Allowed characters are a–z, A–Z, 0–9, _ and -. Uppercase and lowercase letters are different characters.
1.2 Account activity
Every request with a correct password counts as activity of the requesting account. The account view of this account then shows "Last active some seconds ago."
2. API fees
Every request with a correct password costs Gold. The server removes the fee from the requesting account before it processes the request.
| Endpoint | Fee |
|---|---|
/api/gold/send | base fee |
/api/account/get | base fee |
/api/account/create | base fee + 1.00 Gold |
/api/chat/send | base fee |
/api/clan/stats/get | base fee + 0.09 Gold |
/api/gold/seize | base fee + 0.09 Gold |
2.1 Base fee
The base fee depends on the number of API requests of all accounts together in the current minute. The counter is reset to 0 every minute.
| Request number in the current minute (all accounts) | Base fee |
|---|---|
| 1 to 62 | 0.01 Gold |
n = 63 to 260 | (n − 61) × 0.01 Gold |
| 261 or more | 2.00 Gold |
Every successful response contains the field api_fees_cents: the API fee of this request in 0.01 Gold (base fee + extra fee, without the transaction fee).
2.2 When the fee is charged
| Result | Fee charged |
|---|---|
format error in account_name or password, account error for the requesting account, password error, insufficient funds | no |
| All other results, including errors in the other fields | yes |
3. /api/gold/send
Sends Gold from the requesting account to another account.
3.1 Request
| Field | Type | Content |
|---|---|---|
account_name | string | see 1.1 |
password | string | see 1.1 |
target_account_name | string | Account name of the receiver (5 characters). |
amount | integer | Amount in whole Gold: 1 to 1,000,000. |
reference | integer or string | Optional. Payment reference, shown in the transactions log. See below. |
{
"account_name": "AbC12",
"password": "xxxxxxxxxxxxxxx",
"target_account_name": "Zy-9_",
"amount": 25,
"reference": 1042
}
3.2 Response
| Field | Content |
|---|---|
status | "ok" |
api_fees_cents | API fee in 0.01 Gold. |
transaction_fees | Transaction fee in whole Gold. |
account_name | Account name of the sender. |
target_account_name | Account name of the receiver. |
amount | Amount that the receiver received, in whole Gold. |
reference | The payment reference as a string, as it appears in the log. "" without reference. |
A transfer over the API is a normal transaction. In addition to the API fee, the sender pays the transaction fee of 0, 1 or 2 Gold, exactly as for a transfer in the game. The transaction fee is not an API fee and is not included in api_fees_cents. A transfer over the API also counts for the number of recent transactions that sets the transaction fee. See Transactions.
The sender pays amount + transaction fee + API fee. If the balance is too low for amount + transaction fee, the response is transaction error. The API fee is charged in this case. Every transfer appears in the transactions log.
The field reference is optional. Without it, or with an empty string, the transfer has no reference. A reference appears in the transactions log at the end of the line, after the usernames:
- Most accounts may only use a whole number from 0 to 999,999,999,999, for example an order number. It can be a JSON number or a string that contains only digits (at most 12).
- A few accounts are unlocked for text references. Their reference can be any text: the server replaces control characters with spaces and removes the characters
`,<and>. After this removal, the text must have 1 to 140 characters. - If the reference does not follow these rules, the response is
reference error. No Gold is sent, but the API fee is charged.
4. /api/account/get
Returns the data of any account.
4.1 Request
| Field | Type | Content |
|---|---|---|
account_name | string | see 1.1 |
password | string | see 1.1 |
target_account_name | string | Account name of the account to read (5 characters). This can be the requesting account itself. |
4.2 Response
The response contains status, api_fees_cents and the object account_data. All ranks start at 0: rank 0 is the first place.
Field of account_data | Content |
|---|---|
overall_accounts | Number of all accounts. |
username | Current username. |
gold_cents | Gold balance in 0.01 Gold. See Gold. |
gold_rank | Rank in the Gold ranking. |
ovo_elo | 1v1 Elo × 10. Example: 1234 = Elo 123.4. |
ovo_rank | Rank in the 1v1 ranking. |
ovo_played_games | Number of played 1v1 games. |
clan_member_clan_a | Name of the primary clan, or an empty string. See Clans. |
clan_member_clan_b | Name of the secondary clan, or an empty string. |
clan_member_points_a, clan_member_points_b | Monthly points in the primary / secondary clan, in 0.01 points. |
clan_member_total_points_a, clan_member_total_points_b | Total points in the primary / secondary clan, in 0.1 points. |
clan_member_won_games_a, clan_member_won_games_b | Won games in the primary / secondary clan. |
clan_member_rank_a | Rank in the clan member ranking. |
clan_leader_points | Clan leader rating in 0.1 points. |
clan_leader_clan | Name of the clan that this account leads, or an empty string. |
admin_points | Admin points. |
admin_rank | Rank in the admin ranking. |
br_points | Battle Royale points in 0.01 points. |
br_rank | Rank in the Battle Royale ranking. |
zombie_points | Zombie points in 0.01 points. |
zombie_rank | Rank in the Zombie ranking. |
bio_text | Text of the bio. |
bio_state | 0 = no bio, 1 = bio without automatic renewal, 2 = bio with automatic renewal. |
bio_period | Remaining days until the bio must be renewed. |
bio_fee | Current price of a bio period in whole Gold. |
has_patreon | 1 = the account has Patreon membership, 0 = no. |
is_patreon_hidden | 1 = the Patreon membership is hidden, 0 = visible. |
last_online | Time since the last activity, see 4.3. |
online_status | Current activity if the account is online, see 4.3. |
report_power | Report power of the account, rounded to 3 decimal places. The same value is shown in the account view in the game. |
report_remaining | Number of remaining reports and vouches of the account. The value is between 0 and 30. See Reports. |
report_standing | Current standing of the account, rounded to 3 decimal places, while the account was reported or acquitted within the last hour. null in all other cases. |
punishment_muted | 1 = the account is muted in the lobby chat, 0 = no. |
punishment_redacted | 1 = the username of the account is currently redacted as a punishment, 0 = no. |
4.3 Online fields
last_online | Meaning |
|---|---|
| 0 | Online now |
| 1 | Last active some seconds ago |
| 2 to 60 | Last active last_online − 1 minutes ago |
| 61 to 83 | Last active last_online − 60 hours ago |
| 84 to 254 | Last active last_online − 83 days ago |
| 255 | Last active 172 or more days ago |
online_status | Meaning |
|---|---|
| 0 | Browsing the menus |
| 1 | Watching a replay |
| 2 | Playing a Team game |
| 3 | Playing a Battle Royale game |
| 4 | Playing a 1v1 game |
| 5 | Playing a Zombie game |
| 6 | In the lobby |
| 7 | Playing in single player |
online_status is only meaningful when last_online is 0.
5. /api/account/create
Creates a new account. The new account gets the same password as the requesting account.
5.1 Request
{
"account_name": "AbC12",
"password": "xxxxxxxxxxxxxxx"
}
5.2 Response
| Field | Content |
|---|---|
status | "ok" |
api_fees_cents | API fee in 0.01 Gold. |
account_name | Account name of the requesting account. |
new_account_name | Account name of the new account (5 characters). |
5.3 The new account
- The server chooses the account name at random. The requesting account cannot choose the account name.
- The password of the new account is the password that the requesting account has at the time of the request. Login with the new account name and this password.
- The username of the new account is
Player, followed by a space and a number from 0 to 999. - The new account has 0.00 Gold, no clan, no email address and 0 points in all rankings.
- The request does not send Gold to the new account. To send Gold, use /api/gold/send.
6. /api/chat/send
Writes a message from the requesting account in the lobby chat.
6.1 Request
| Field | Type | Content |
|---|---|---|
account_name | string | see 1.1 |
password | string | see 1.1 |
message | string | The text of the message. |
lobby | integer, optional | The lobby whose chat shows the message: 1 = lobby 1 (the lobby of the button "Multiplayer" on the start screen), 2 = lobby 2 (the lobby of the button "Join Lobby 2" in the menu). If the field is missing, the value is 1. Every other value gives the response format error. |
{
"account_name": "AbC12",
"password": "xxxxxxxxxxxxxxx",
"message": "Hello lobby!",
"lobby": 1
}
6.2 Response
| Field | Content |
|---|---|
status | "ok" |
api_fees_cents | API fee in 0.01 Gold. |
account_name | Account name of the requesting account. |
message | The text as it is shown in the lobby chat (see 6.3). |
lobby | The lobby that received the message: 1 or 2. |
6.3 Rules
- The server replaces control characters, for example line breaks and tabs, with spaces.
- The server removes the characters
`,<and>from the text. - After this removal, the text must have 1 to 255 characters. Otherwise, the response is
message error. - An account that is muted in the lobby chat cannot write. The response is
muted. See Reports. - The requesting account does not need multiplayer play time. It does not need to be in the lobby.
- The lobby chat shows the message with
[Bot]in front of the username of the requesting account. Example: the usernameAliceis shown as[Bot] Alice. If the username is empty, the lobby chat shows[Bot]in front of the account name. - Only players who have the lobby chat open at this moment receive the message. Players who open the lobby chat later see the message among the last messages of the lobby chat.
- The message appears only in the chat of the lobby given in
lobby. It does not appear in the chat of the other lobby. - The response
okmeans that the server accepted the message and forwarded it to the lobby. - Every message also appears in the public chat log territorial.io/log/chat, which shows the newest messages of the lobby chat.
7. /api/clan/stats/get
Returns the history of the clan points of 1 clan.
7.1 Request
| Field | Type | Content |
|---|---|---|
account_name | string | see 1.1 |
password | string | see 1.1 |
clan | string | Clan name without brackets, for example "ABC". Uppercase and lowercase letters are treated the same. |
timeframe | string | Interval between 2 values: "M1" (1 minute), "M5" (5 minutes), "H1" (1 hour), "H4" (4 hours), "D1" (1 day), "W1" (1 week) or "MN" (1 month). |
7.2 Response
| Field | Content |
|---|---|
status | "ok" |
api_fees_cents | API fee in 0.01 Gold. |
clan | Clan name in uppercase letters. |
timeframe | Time frame in uppercase letters. |
values | Array of at most 128 integers. Every value is the clan points × 1000 at the end of 1 interval (example: 12345 = 12.345 clan points). The oldest value is first. The current value is not included. |
All times are UTC. A day starts at 00:00, a week starts on Sunday at 00:00, a month starts on the 1st at 00:00.
8. /api/gold/seize
Moves Gold from any account to the requesting account. Only accounts that are unlocked for this endpoint can use it. For every other account, the response is permission error. The list of unlocked accounts is not published.
8.1 Request
| Field | Type | Content |
|---|---|---|
account_name | string | see 1.1 |
password | string | see 1.1 |
target_account_name | string | Account name of the account that loses the Gold (5 characters). |
amount | integer | Amount to seize in whole Gold: 1 to 1,000,000. If the target account has less Gold, less is seized (see 8.3). |
reason | string | The reason for the seize. It appears in the transactions log (see 8.3). |
{
"account_name": "AbC12",
"password": "xxxxxxxxxxxxxxx",
"target_account_name": "Zy-9_",
"amount": 25,
"reason": "Gold won by exploiting a bug"
}
8.2 Response
| Field | Content |
|---|---|
status | "ok" |
api_fees_cents | API fee in 0.01 Gold. |
account_name | Account name of the requesting account. This account received the Gold. |
target_account_name | Account name of the account that lost the Gold. |
amount | The value of amount from the request, in whole Gold. |
seized_cents | Amount that was moved, in 0.01 Gold. If the target account had at least amount Gold, the value is 100 × amount. If the target account had less than amount Gold, the value is the complete balance of the target account before the seize. If the target account had 0 Gold, the value is 0. |
reason | The reason as it is shown in the transactions log (see 8.3). |
8.3 Rules
- If the target account has at least
amountGold, exactlyamountGold is moved. - If the target account has less than
amountGold, the complete balance of the target account is moved, including amounts smaller than 1 Gold. The balance of the target account is then exactly 0 Gold. - If the target account has 0 Gold, no Gold is moved. The response is
okwithseized_cents0. The seize does not appear in the transactions log. - A seize never makes the balance of the target account negative.
- No transaction fee is charged, neither to the target account nor to the requesting account. The requesting account pays only the API fee.
- The target account cannot be the requesting account. In this case, the response is
account error. - The server replaces control characters in
reason, for example line breaks and tabs, with spaces. The server removes the characters`,<and>. After this removal, the reason must have 1 to 200 characters. Otherwise, the response isreason error. - The total amount of Gold that can be seized per day is limited. The limit counts the Gold that was actually moved (
seized_cents), notamount. If the Gold that a seize would move exceeds this limit, the response islimit errorand no Gold is moved. - Every seize that moves more than 0 Gold appears in the transactions log with the action
Seize, from the target account to the requesting account, with the fee 0.00 and the reason at the end of the line.
9. Status values
The field status has exactly 1 of these values:
| Status | Meaning |
|---|---|
ok | The request was successful. |
format error | The body is not valid JSON, or a field is missing or has the wrong type. |
invalid url | The path is not 1 of the 6 endpoints. |
account error | account_name or target_account_name does not exist. |
password error | The password is wrong. |
insufficient funds | The requesting account has less Gold than the API fee. |
amount error | amount is smaller than 1 or larger than 1,000,000. |
transaction error | /api/gold/send: the sender has not enough Gold for amount + transaction fee. |
invalid timeframe | timeframe is not 1 of the 7 allowed values. |
invalid clan | A clan with this name does not exist. |
creation error | The server cannot create more accounts. |
message error | The text of message has 0 or more than 255 characters after the removal of `, < and >. |
muted | The requesting account is muted in the lobby chat. |
lobby error | The lobby is not reachable at the moment. Try again later. |
permission error | The requesting account is not unlocked for /api/gold/seize. |
reason error | The text of reason has 0 or more than 200 characters after the removal of `, < and >. |
reference error | /api/gold/send: reference is not a whole number from 0 to 999,999,999,999, or, for an account that is unlocked for text references, the text has 0 or more than 140 characters after the removal of `, < and >. |
limit error | The seize would exceed the daily limit of /api/gold/seize. No Gold was moved. |
10. Public logs and data pages
These pages are free, need no account and may be read by programs. /clans, /players, /log/chat, /log/reports and /log/transactions are plain text. The other logs under /log/ are HTML pages that contain the text in 1 <pre> element. In these other logs, newer entries are at the top. In /log/chat, /log/reports and /log/transactions, newer entries are at the bottom.
10.1 Request limit
- Do not send too many requests to these pages and to the wiki.
- If a program sends too many requests, the server answers with the HTTP status 403 and an empty body. The API endpoints in sections 3 to 8 are not affected.
- A program that receives 403 must stop all requests to these pages for 2 hours. Requests during this time extend the block.
| Address | Content | Update |
|---|---|---|
| territorial.io/clans | The 100 clans with the most clan points: rank, name, clan points with 4 decimal places. | every minute |
| territorial.io/players | The 500 best 1v1 players: rank, username, Elo, played games. | every full hour |
| territorial.io/log/team-games | The last 48 Team games: time, contest, map, player count, winning clan, clan points before and after, Gold payouts, winners of the top clan. | after every Team game |
| territorial.io/log/br | The last 64 Battle Royale games with the Gold payouts of the winners. | after every Battle Royale game |
| territorial.io/log/1v1 | The last 64 1v1 games: winner and loser with Elo, rank and account name, Gold payout of the winner. | after every 1v1 game |
| territorial.io/log/zombies | The last 64 Zombie games with the Gold payouts of the winners. | after every Zombie game |
| territorial.io/log/transactions | Plain text. The latest Gold transfers, the newest at the bottom. Every line contains in fixed columns: time (UTC), action (Send or Seize), account name of the sender and of the receiver, amount and fee in Gold. The usernames follow at the end of the line, then the payment reference, if there is one (see 3). A seize (see 8) appears with the action Seize, from the target account to the requesting account, with the reason instead of a reference. The server removes older lines automatically. | after every transfer, with a delay |
| territorial.io/log/clan-leader-election | The last 48 clan leader votes: voter, votes, elected account, new rating. | after every vote |
| territorial.io/log/chat | Plain text. The latest messages of the lobby chat, the newest message at the bottom. The server removes older messages automatically. Every line contains in fixed columns: time (UTC), lobby (S1 = lobby 1, S2 = lobby 2) and account name. The username (the account name if the username is empty) and the text follow at the end of the line. Messages written with the API have [Bot] in front of the name. | after new chat messages, with a delay |
| territorial.io/log/reports | Plain text. The latest reports and vouches, the newest at the bottom. Every line contains in fixed columns: time (UTC), action (Report or Vouch), account name of the acting account and of the target account, the standing of the target before and after the action, and punished or refunded if the action led to a punishment or a refund. The usernames follow at the end of the line. A line with the action Remove shows that the standing of an account was removed; ended means that the punishment of this account ended. The server removes older lines automatically. See Reports. | after new reports and vouches, with a delay |
| territorial.io/log/propaganda | The last 48 propaganda events, for example launched campaigns with propagandist, target language, funding and text. See Propaganda. | after every event |
A replay of a multiplayer game has the address https://territorial.io/log/?r=<ID>. The link to the replay appears at the end of each game.