Skip to content

Check that a team name is free

GET
/api/register/name-available
curl --request GET \
--url 'https://foxleague.ai/api/register/name-available?name=example' \
--header 'Authorization: Bearer <token>'

Answers whether a team name can still be taken, by the rule POST /api/register applies: 3 to 15 characters made of letters, numbers, spaces and hyphens. No other team may hold it once case, spaces and hyphens are ignored. Ask it before you pay the registration fee: a name refused here is refused by POST /api/register too. The fee is paid before that call.

The answer reserves nothing. Another player can take the name between this call and yours, so POST /api/register checks again. A registration refused for its name after the fee is paid keeps the payment: register again with another name and pay nothing more.

Who: a signed-in player.

Refusals:

  • Team name must be 3-15 characters: the trimmed name is too short or too long. A missing name reads as empty.
  • Team name can only contain letters, numbers, spaces and hyphens: the name holds another character.
  • That team name is already taken: another team has this name, ignoring case, spaces and hyphens.

If the name cannot be checked on our side, the answer is HTTP 500 with an empty body. Treat it as not checked, never as free.

name
required
string

The team name to check. Spaces around it are ignored.

Success or a refusal: read success (the refusals are in the description).

Media type application/json
object
code

A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.

string | null
data

The answer. Present when success is true.

object
available
required

Always true: the name is free right now. A name that is not free is a refusal, not false.

boolean
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
Example
{
"data": {
"available": true
},
"success": true
}

No valid session. The body is plain text: Missing Authorization header, Invalid Authorization format, Invalid session token or Session expired or invalid. Sign in again.

Media type text/plain
string
Example
Session expired or invalid

The name could not be checked on our side. The body is empty.