Skip to content

Account routes

Generated from openapi.yaml of games-api 0.7.0: 8 routes.

POST /v1/account/magic-link

POST /v1/account/magic-link

Terminal window
curl -X POST 'https://api.filudi.com/v1/account/magic-link' \
-H "authorization: Bearer $FILUDI_PLAYER_TOKEN" \
-H 'content-type: application/json' \
-d '{
"email": "you@example.com",
"redirect": "string"
}'

Email a sign-in link

Credential: a player token (fp1), sent as Authorization: Bearer <token>. A game token (fg1) answers 401 here.

application/json, required.

PropertyTypeRequiredDescription
emailstring (email)yes
redirectstringnoPath on the site to return to after verification
StatusBodyDescription
202noneSent, or silently not sent for an unknown reason the client must not learn.
403noneAccounts are off for this site.
429ErrorToo many requests. Headers: Retry-After.

POST /v1/account/magic-link/consume

POST /v1/account/magic-link/consume

Terminal window
curl -X POST 'https://api.filudi.com/v1/account/magic-link/consume' \
-H "authorization: Bearer $FILUDI_PLAYER_TOKEN" \
-H 'content-type: application/json' \
-d '{
"token": "string"
}'

Exchange the link token for an account player token

With a guest token, the API merges the guest into the account player (ADR 0005).

Credential, optional: a player token (fp1), sent as Authorization: Bearer <token>. A game token (fg1) answers 401 here. Without a token the answer is the anonymous one.

application/json, required.

PropertyTypeRequiredDescription
tokenstringyes
StatusBodyDescription
200ConsumeResponseAccount player and token.
400noneLink expired, used or unknown.
403noneAccounts are off for this site.

POST /v1/account/magic-link/consume-code

POST /v1/account/magic-link/consume-code

Terminal window
curl -X POST 'https://api.filudi.com/v1/account/magic-link/consume-code' \
-H "authorization: Bearer $FILUDI_PLAYER_TOKEN" \
-H 'content-type: application/json' \
-d '{
"email": "you@example.com",
"code": "string",
"site": "filudi"
}'

Exchange the code of a sign-in email for an account player token

Same effect as consuming the link (ADR 0011). The page that asked for the link sends the 6-digit code the email shows; spaces are ignored. The API checks it against the most recent link of this email on the site that is neither consumed nor expired. The fifth wrong code burns that link. The site is the token’s; without a token, site names it. An invalid or dead bearer counts as no token, and site is then required. redirect is never set: it travels inside the link, not with the code. 20 attempts per IP per hour.

Credential, optional: a player token (fp1), sent as Authorization: Bearer <token>. A game token (fg1) answers 401 here. Without a token the answer is the anonymous one.

application/json, required.

PropertyTypeRequiredDescription
emailstring (email)yes
codestringyesSix digits, “123456” or “123 456”; pattern ^[0-9 ]{6,7}$
sitestringnoSite slug. Required without a player token; with one, it must be the token’s site
StatusBodyDescription
200ConsumeResponseAccount player and token.
400Error“This code is wrong, expired or already used. Ask for a new email.” Also a missing or mismatched site, and an account scheduled for deletion.
403noneAccounts are off for this site.
404noneUnknown site slug.
429ErrorToo many requests. Headers: Retry-After.
503noneRedis is down; the rate limit cannot be checked.

POST /v1/account/sign-in

POST /v1/account/sign-in

Terminal window
curl -X POST 'https://api.filudi.com/v1/account/sign-in' \
-H "authorization: Bearer $FILUDI_PLAYER_TOKEN" \
-H 'content-type: application/json' \
-d '{
"email": "you@example.com",
"password": "string",
"site": "filudi"
}'

Sign in with email and password

For an account that set a password (ADR 0011). With a guest token of the site, the API merges the guest into the account as consume does. An unknown email, an account without a password and a wrong password get the same 401 in the same time. The site is the token’s; without a token, site names it. An invalid or dead bearer counts as no token, and site is then required. 10 attempts per email per 15 minutes and 30 per IP per hour, right or wrong.

Credential, optional: a player token (fp1), sent as Authorization: Bearer <token>. A game token (fg1) answers 401 here. Without a token the answer is the anonymous one.

application/json, required.

PropertyTypeRequiredDescription
emailstring (email)yes
passwordstringyesA password over 128 characters answers 401; the 8 to 128 rule applies when it is set; 1 to 1024 characters; write only
sitestringnoSite slug. Required without a player token; with one, it must be the token’s site
StatusBodyDescription
200ConsumeResponseAccount player and token.
400ErrorA missing or mismatched site, or an account scheduled for deletion.
401Error“Email or password is wrong.”.
403noneAccounts are off for this site.
404noneUnknown site slug.
429ErrorToo many requests. Headers: Retry-After.
503noneRedis is down; the rate limit cannot be checked.

PUT /v1/account/password

PUT /v1/account/password

Terminal window
curl -X PUT 'https://api.filudi.com/v1/account/password' \
-H "authorization: Bearer $FILUDI_PLAYER_TOKEN" \
-H 'content-type: application/json' \
-d '{
"password": "string",
"current": "string"
}'

Set or change the account’s password

Account players only (ADR 0011). 8 to 128 characters after NFC normalization, not equal to the account’s email (case-insensitive), no other rule. When a password exists, current is required and checked. 20 attempts per player per hour, right or wrong. Other devices stay signed in.

Credential: a player token (fp1), sent as Authorization: Bearer <token>. A game token (fg1) answers 401 here.

application/json, required.

PropertyTypeRequiredDescription
passwordstringyes8 to 128 characters; write only
currentstringnoRequired when the account has a password; 1 to 128 characters; write only
StatusBodyDescription
204noneSaved.
400ErrorValidation failed.
401ErrorMissing or invalid token, or current is wrong; then the body carries details: { field: "current" }.
403noneA guest: “Add your email first: a password needs an account.”.
429ErrorToo many requests. Headers: Retry-After.
503noneRedis is down; the rate limit cannot be checked.

DELETE /v1/account/password

DELETE /v1/account/password

Terminal window
curl -X DELETE 'https://api.filudi.com/v1/account/password' \
-H "authorization: Bearer $FILUDI_PLAYER_TOKEN"

Remove the password; the account signs in by link or code only

Credential: a player token (fp1), sent as Authorization: Bearer <token>. A game token (fg1) answers 401 here.

StatusBodyDescription
204noneRemoved.
401ErrorMissing or invalid token.
403noneA guest has no password.

GET /v1/account/export

GET /v1/account/export

Terminal window
curl 'https://api.filudi.com/v1/account/export' \
-H "authorization: Bearer $FILUDI_PLAYER_TOKEN"

Everything stored about the player

Credential: a player token (fp1), sent as Authorization: Bearer <token>. A game token (fg1) answers 401 here.

StatusBodyDescription
200PlayerExportJSON file. Headers: Content-Disposition.

DELETE /v1/account

DELETE /v1/account

Terminal window
curl -X DELETE 'https://api.filudi.com/v1/account' \
-H "authorization: Bearer $FILUDI_PLAYER_TOKEN"

Delete the player and all data

Scheduled; cron:purge removes the rows within 24 hours. The token stops working now.

Credential: a player token (fp1), sent as Authorization: Bearer <token>. A game token (fg1) answers 401 here.

StatusBodyDescription
202noneDeletion scheduled.