Skip to content

Console routes

Sign-in, account, invitations and sessions of the console and the back office (ADR 0015). Generated from openapi.yaml of games-api 0.7.0: 19 routes.

POST /v1/console/sign-in

POST /v1/console/sign-in

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

Sign in with email and password

Sets the filudi_console cookie (ADR 0015). When the account has TOTP, totpRequired is true, me is absent and the cookie holds a pending sign-in for 5 minutes: finish with POST /v1/console/sign-in/totp. An unknown email and a wrong password get the same 401 in the same time. Attempts are limited per email and per IP in Redis, as POST /v1/account/sign-in does.

Credential: none. The route is public.

application/json, required.

PropertyTypeRequiredDescription
emailstring (email)yes
passwordstringyes1 to 1024 characters; write only
StatusBodyDescription
200SignInResultSigned in, or a TOTP code is due. Headers: Set-Cookie (filudi_console).
401Error“Email or password is wrong.”.
403noneThe account is disabled.
429ErrorToo many requests. Headers: Retry-After.
503noneRedis is down; the rate limit cannot be checked.

POST /v1/console/sign-in/totp

POST /v1/console/sign-in/totp

Terminal window
curl -X POST 'https://api.filudi.com/v1/console/sign-in/totp' \
-b "filudi_console=$FILUDI_SESSION" \
-H 'origin: https://developers.filudi.com' \
-H 'content-type: application/json' \
-d '{
"code": "string"
}'

Finish a sign-in with the 6-digit code of the authenticator

Needs the pending cookie of POST /v1/console/sign-in. The code is RFC 6238, 30-second step, one step of drift either way; a code is accepted once. The fifth wrong code ends the pending sign-in.

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

application/json, required.

PropertyTypeRequiredDescription
codeTotpCodeyesSix digits, “123456” or “123 456”; pattern ^[0-9 ]{6,7}$
StatusBodyDescription
200ConsoleMeSigned in; the cookie now holds a 14-day session.
400ErrorWrong code. On the fifth wrong code the pending sign-in is gone, the cookie is cleared and details.signInEnded is true.
401noneNo pending sign-in.

POST /v1/console/sign-out

POST /v1/console/sign-out

Terminal window
curl -X POST 'https://api.filudi.com/v1/console/sign-out' \
-b "filudi_console=$FILUDI_SESSION" \
-H 'origin: https://developers.filudi.com'

Sign out

Deletes the session row and clears the cookie. Answers 204 without a session too.

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

StatusBodyDescription
204noneSigned out.

GET /v1/console/me

GET /v1/console/me

Terminal window
curl 'https://api.filudi.com/v1/console/me' \
-b "filudi_console=$FILUDI_SESSION"

The signed-in account

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

StatusBodyDescription
200ConsoleMeAccount.
401ErrorMissing or invalid token.

PATCH /v1/console/me

PATCH /v1/console/me

Terminal window
curl -X PATCH 'https://api.filudi.com/v1/console/me' \
-b "filudi_console=$FILUDI_SESSION" \
-H 'origin: https://developers.filudi.com' \
-H 'content-type: application/json' \
-d '{
"name": "string"
}'

Change the display name

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

application/json, required.

PropertyTypeRequiredDescription
nameAccountNameyesDisplay name, shown to other members and in the audit log; 1 to 80 characters
StatusBodyDescription
200ConsoleMeAccount.
400ErrorValidation failed.
401ErrorMissing or invalid token.

GET /v1/console/invitations/{token}

GET /v1/console/invitations/{token}

Terminal window
curl 'https://api.filudi.com/v1/console/invitations/string'

What an invitation grants, for the accept page

Credential: none. The route is public.

NameInTypeRequiredDescription
tokenpathstringyesThe token of the invitation link
StatusBodyDescription
200InvitationPreviewInvitation.
404noneUnknown, expired, accepted or revoked: one answer for the four.

POST /v1/console/invitations/{token}/accept

POST /v1/console/invitations/{token}/accept

Terminal window
curl -X POST 'https://api.filudi.com/v1/console/invitations/string/accept' \
-H 'content-type: application/json' \
-d '{
"name": "string",
"password": "string"
}'

Accept an invitation; this creates the account and signs it in

The password follows the policy of PUT /v1/account/password: 8 to 128 characters after NFC normalization, not equal to the email. The token is single use. Sets the filudi_console cookie.

Credential: none. The route is public.

NameInTypeRequiredDescription
tokenpathstringyesThe token of the invitation link

application/json, required.

PropertyTypeRequiredDescription
nameAccountNameyesDisplay name, shown to other members and in the audit log; 1 to 80 characters
passwordNewPasswordyesThe policy of PUT /v1/account/password: 8 to 128 characters after NFC normalization, not equal to the email; 8 to 128 characters; write only
StatusBodyDescription
200ConsoleMeAccount created and signed in. Headers: Set-Cookie (filudi_console).
400noneThe password breaks the policy.
404noneUnknown, expired, accepted or revoked.

POST /v1/console/password/forgot

POST /v1/console/password/forgot

Terminal window
curl -X POST 'https://api.filudi.com/v1/console/password/forgot' \
-H 'content-type: application/json' \
-d '{
"email": "you@example.com"
}'

Email a password reset link

Answers 202 whether the email is on an account or not. Limited per email and per IP in Redis.

Credential: none. The route is public.

application/json, required.

PropertyTypeRequiredDescription
emailstring (email)yes
StatusBodyDescription
202noneSent, or silently not sent.
429ErrorToo many requests. Headers: Retry-After.

POST /v1/console/password/reset

POST /v1/console/password/reset

Terminal window
curl -X POST 'https://api.filudi.com/v1/console/password/reset' \
-H 'content-type: application/json' \
-d '{
"token": "string",
"password": "string"
}'

Set a new password from a reset link

Same policy as PUT /v1/account/password. The token is single use. Other sessions of the account stay signed in.

Credential: none. The route is public.

application/json, required.

PropertyTypeRequiredDescription
tokenstringyes
passwordNewPasswordyesThe policy of PUT /v1/account/password: 8 to 128 characters after NFC normalization, not equal to the email; 8 to 128 characters; write only
StatusBodyDescription
204noneSaved.
400noneThe password breaks the policy.
404noneUnknown, expired or used token.

PUT /v1/console/password

PUT /v1/console/password

Terminal window
curl -X PUT 'https://api.filudi.com/v1/console/password' \
-b "filudi_console=$FILUDI_SESSION" \
-H 'origin: https://developers.filudi.com' \
-H 'content-type: application/json' \
-d '{
"current": "string",
"password": "string"
}'

Change the password

Same policy as PUT /v1/account/password. Other sessions stay signed in.

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

application/json, required.

PropertyTypeRequiredDescription
currentstringyes1 to 128 characters; write only
passwordNewPasswordyesThe policy of PUT /v1/account/password: 8 to 128 characters after NFC normalization, not equal to the email; 8 to 128 characters; write only
StatusBodyDescription
204noneSaved.
400noneThe password breaks the policy.
401ErrorMissing session, or current is wrong; then the body carries details: { field: "current" }.

POST /v1/console/email

POST /v1/console/email

Terminal window
curl -X POST 'https://api.filudi.com/v1/console/email' \
-b "filudi_console=$FILUDI_SESSION" \
-H 'origin: https://developers.filudi.com' \
-H 'content-type: application/json' \
-d '{
"password": "string",
"email": "you@example.com"
}'

Ask to change the email address

A confirmation link goes to the new address. The account keeps its current email until POST /v1/console/email/confirm.

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

application/json, required.

PropertyTypeRequiredDescription
passwordstringyes1 to 128 characters; write only
emailstring (email)yes
StatusBodyDescription
202noneConfirmation link sent to the new address.
401ErrorMissing session, or the password is wrong.
409noneThe email is already on an account.

POST /v1/console/email/confirm

POST /v1/console/email/confirm

Terminal window
curl -X POST 'https://api.filudi.com/v1/console/email/confirm' \
-H 'content-type: application/json' \
-d '{
"token": "string"
}'

Confirm a new email address from its link

Credential: none. The route is public.

application/json, required.

PropertyTypeRequiredDescription
tokenstringyes
StatusBodyDescription
204noneEmail changed.
404noneUnknown, expired or used token.
409noneThe email went on another account in the meantime.

POST /v1/console/totp

POST /v1/console/totp

Terminal window
curl -X POST 'https://api.filudi.com/v1/console/totp' \
-b "filudi_console=$FILUDI_SESSION" \
-H 'origin: https://developers.filudi.com'

Start a TOTP enrolment

Answers a new secret and its otpauth:// URL for the authenticator app. The secret is not active until POST /v1/console/totp/confirm accepts a code; starting again replaces an unconfirmed secret. Staff without TOTP gets 403 on every /v1/admin/* route except GET /v1/admin/me.

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

StatusBodyDescription
200TotpEnrolmentSecret to show once.
401ErrorMissing or invalid token.
409noneTOTP is already enabled; remove it first.

DELETE /v1/console/totp

DELETE /v1/console/totp

Terminal window
curl -X DELETE 'https://api.filudi.com/v1/console/totp' \
-b "filudi_console=$FILUDI_SESSION" \
-H 'origin: https://developers.filudi.com' \
-H 'content-type: application/json' \
-d '{
"code": "string"
}'

Remove TOTP, with a current code

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

application/json, required.

PropertyTypeRequiredDescription
codeTotpCodeyesSix digits, “123456” or “123 456”; pattern ^[0-9 ]{6,7}$
StatusBodyDescription
204noneRemoved.
400noneWrong code.
401ErrorMissing or invalid token.

POST /v1/console/totp/confirm

POST /v1/console/totp/confirm

Terminal window
curl -X POST 'https://api.filudi.com/v1/console/totp/confirm' \
-b "filudi_console=$FILUDI_SESSION" \
-H 'origin: https://developers.filudi.com' \
-H 'content-type: application/json' \
-d '{
"code": "string"
}'

Confirm the enrolment with a first code; TOTP is on from here

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

application/json, required.

PropertyTypeRequiredDescription
codeTotpCodeyesSix digits, “123456” or “123 456”; pattern ^[0-9 ]{6,7}$
StatusBodyDescription
204noneTOTP enabled.
400noneWrong code, or no enrolment started.
401ErrorMissing or invalid token.

GET /v1/console/sessions

GET /v1/console/sessions

Terminal window
curl 'https://api.filudi.com/v1/console/sessions' \
-b "filudi_console=$FILUDI_SESSION"

The account’s sessions, newest first

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

StatusBodyDescription
200ConsoleSessionInfo[]Sessions.
401ErrorMissing or invalid token.

DELETE /v1/console/sessions/{sessionId}

DELETE /v1/console/sessions/{sessionId}

Terminal window
curl -X DELETE 'https://api.filudi.com/v1/console/sessions/00000000-0000-0000-0000-000000000000' \
-b "filudi_console=$FILUDI_SESSION" \
-H 'origin: https://developers.filudi.com'

Revoke one session; revoking the current one signs this browser out

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

NameInTypeRequiredDescription
sessionIdpathstring (uuid)yes
StatusBodyDescription
204noneRevoked.
401ErrorMissing or invalid token.
404noneNot a session of this account.

POST /v1/console/impersonation/end

POST /v1/console/impersonation/end

Terminal window
curl -X POST 'https://api.filudi.com/v1/console/impersonation/end' \
-b "filudi_console=$FILUDI_SESSION" \
-H 'origin: https://developers.filudi.com'

End an impersonation

Send it with X-Filudi-Impersonation: 1. Deletes the impersonation session and clears the filudi_impersonation cookie.

Credential: the console session cookie filudi_console, set by POST /v1/console/sign-in. From a browser, send credentials: 'include'; on a non-GET request the Origin header must be one of the console origins. With X-Filudi-Impersonation: 1 the API reads the filudi_impersonation cookie instead.

StatusBodyDescription
204noneEnded.
401noneNo impersonation session.

POST /v1/console/invitation-requests

POST /v1/console/invitation-requests

Terminal window
curl -X POST 'https://api.filudi.com/v1/console/invitation-requests' \
-H 'content-type: application/json' \
-d '{
"email": "you@example.com",
"wants": [
"games"
],
"message": "string"
}'

Ask for an invitation, from the form on developers.filudi.com

Stored for staff, who invites or dismisses. No email is sent. 5 requests per IP per day.

Credential: none. The route is public.

application/json, required. The body is a InvitationRequestInput.

PropertyTypeRequiredDescription
emailstring (email)yesat most 254 characters
wantsarray of one of "games", "portals"yesWhat they build; 1 to 2 items; unique items
messagestringyesCounted after trim; 1 to 500 characters
StatusBodyDescription
202noneStored.
400ErrorValidation failed.
429ErrorToo many requests. Headers: Retry-After.
503noneRedis is down; the rate limit cannot be checked.