Console
Friends

Presence Heartbeat

Updates the user's online status and returns the complete friends list with current presence for each friend. Call every 30 seconds from the launcher.

POST /api/vaneltonid/presence_heartbeat.php
Requires Authorization: AppID:AppKey + user token

Request body

FieldTypeRequiredDescription
tokenstringrequiredUser's session token
statusstringrequiredonline or in-game
current_appstringoptionalApp package ID — required when status is in-game

Success response 200

{
  "success": true,
  "friends": [
    {
      "id": 10,
      "userKey": "xyz...",
      "username": "friend1",
      "name": "Friend One",
      "profileimg": "https://...",
      "status": "in-game",
      "current_app": "com.vaneltongd.fzsoccer",
      "last_seen": "2026-05-29 14:32:10"
    },
    {
      "id": 11,
      "username": "friend2",
      "status": "offline",
      "current_app": null,
      "last_seen": "2026-05-29 13:00:00"
    }
  ],
  "unread_notifications": 2
}

Friends are ordered: onlinein-gameoffline. A user becomes offline automatically when the heartbeat TTL (3 minutes) expires — no explicit logout call is needed.

unread_notifications is a count of unread social notifications (friend requests, game invites, etc.). Use this as a signal to call notifications_poll.