Skip to content
Download all docs .md

Signing Game Users In (API)

After a player has signed up, they sign in with their email and password on later visits.

Sign in users

Scope

Sign a player in and get a new authentication token for them.

Important

The token comes back in the JSON body as authentication_token. Send it on later requests in the authentication-token request header.

One sign-in at a time

Every successful sign-in makes a new token, and the player's previous token stops working at once. So signing in on a second device or browser tab signs the player out of the first: its next request gets 401 with Could not validate the current user with that authentication token. When your game gets that, send the player to your sign-in screen. Signing up and signing out (DELETE /api/v3/sessions/:id) also replace the token. Tokens do not expire on a timer.

Method

POST

https://gamefuse.co/api/v3/sessions

Attributes

None

Data (payload)

Send a JSON body (Content-Type: application/json). Form data and query parameters also work. Parameter names are snake_case.

Name Type Required Description
game_id integer Yes Your game's ID, from the dashboard
email string Yes The player's email (not the username). Not case-sensitive.
password string Yes The player's password

game_token is not needed here (it is accepted and ignored).

Headers

Name Type Description
Content-Type string application/json

Responses

HTTP status code Content-Type Body
200 application/json The player and all their data, see below
401 text/plain Incorrect Password
402 text/plain Game is disabled - if you are the developer of this game see your GameFuse dashboard
404 text/plain User Not Found! (no player with that email in this game, or a wrong game_id)
500 text/plain Unknown server error. We have reported it and will look into it ASAP.

Error bodies are plain text sentences, not JSON. Because 404 and 401 differ, consider showing one message such as "Email or password is wrong" for both.

Response object

Attribute name Type Description
id integer The player's GameFuse user ID
username string The username
email string The player's email
credits integer Credits for your in-game store
score integer A general score
is_new_user boolean false (it is true only in the sign-up response)
last_login string Time of this sign-in
number_of_logins integer Total sign-ins, sign-up included
authentication_token string The new token
game_sessions_total, game_sessions_current_month integer Sessions this player has started
events_total, events_current_month integer API requests this player has made
game_user_attributes list The player's custom data: [{ "key": "...", "value": "..." }]
game_user_store_items list Store items the player owns: [{ name, category, description, icon_url, cost, id }]
friends, incoming_friend_requests, outgoing_friend_requests list See Friends
groups, group_join_requests, group_invites list See Groups

Examples

Example

cURL

curl --request POST \
    --header 'Content-Type: application/json' \
    --data '{"email": "john.doe@example.com", "password": "secret-password", "game_id": 123}' \
    https://gamefuse.co/api/v3/sessions

Response

{
    "id": 4567,
    "username": "jdoe",
    "credits": 50,
    "score": 1200,
    "email": "john.doe@example.com",
    "is_new_user": false,
    "last_login": "2026-11-30T17:05:00.000-05:00",
    "number_of_logins": 2,
    "authentication_token": "nEw456ToKeN789aBcDeF",
    "game_sessions_current_month": 2,
    "game_sessions_total": 2,
    "events_total": 14,
    "events_current_month": 14,
    "game_user_attributes": [
        { "key": "CURRENT_LEVEL", "value": "5" }
    ],
    "game_user_store_items": [
        { "name": "Fire Bow", "category": "bows", "description": "Shoots fire arrows", "icon_url": null, "cost": 40, "id": 337 }
    ],
    "friends": [],
    "outgoing_friend_requests": [],
    "incoming_friend_requests": [],
    "groups": [],
    "group_join_requests": [],
    "group_invites": []
}

Use the token

Send it as a header on requests that need a signed-in player:

curl --header "authentication-token: nEw456ToKeN789aBcDeF" \
    "https://gamefuse.co/api/v3/games/123/leaderboard_entries?leaderboard_name=high-scores&limit=10"

A missing, wrong or replaced token gets 401 (text/plain) with Request missing user authentication token or Could not validate the current user with that authentication token. A route you switched off for players on the dashboard's API access tab gets 401 with Game users (via authentication token) for this game are not allowed to access this route. ....