Skip to main content

Overview

Connect with other users through friend requests and direct messages.

Features

Friend Requests

Send and accept friend requests

Direct Messages

Private 1-on-1 conversations

Blocking

Block unwanted users

Online Status

See when friends are online

Friend Requests

Sending Requests

Send a friend request by username:
POST /api/friends/requests
{
  "username": "friend#1234"
}

Accepting Requests

Accept incoming friend requests:
POST /api/friends/requests/:friendship_id/accept

Declining Requests

Decline friend requests:
POST /api/friends/requests/:friendship_id/decline

View Pending Requests

See incoming requests:
GET /api/friends/requests/pending
See outgoing requests:
GET /api/friends/requests/outgoing

Friends List

View all friends:
GET /api/friends
Response includes:
  • Friend’s profile
  • Online status
  • Last seen
  • Mutual servers

Direct Messages

Creating DMs

Start a DM conversation:
GET /api/dms/:current_user_id/:other_user_id

Sending DMs

Send a direct message:
POST /api/dms/:user_id/:dm_id/messages
{
  "content": "Hey! How are you?"
}

DM Features

  • Real-time delivery
  • Typing indicators
  • Read receipts
  • File attachments
  • Message reactions

Blocking

Block a User

POST /api/friends/block/:user_id
Blocked users:
  • Cannot send you friend requests
  • Cannot send you DMs
  • Cannot see your online status
  • Are removed from your friends list

Unblock a User

DELETE /api/friends/block/:user_id

View Blocked Users

GET /api/friends/blocked

Removing Friends

Remove someone from your friends list:
DELETE /api/friends/:friend_user_id

Privacy Settings

Control who can:
  • Send you friend requests
  • Send you DMs
  • See your online status
PATCH /api/users/:user_id/privacy
{
  "allow_friend_requests": true,
  "allow_dms_from_non_friends": false,
  "show_online_status": true
}

Next Steps