Duvet DOCS
GitHub

Friend Events

FRIEND_REQUEST_CREATE

EVENT FRIEND_REQUEST_CREATE

Sent when a friend request is sent: to the recipient, and to the sender's sessions so they can add it to their sent requests. Compare sender_id with your own ID to tell which one you are.

FieldTypeDescription
id stringFriend request ID
sender_id stringID of the user who sent the request
username stringUsername of the sender
alias string?Display name of the sender
avatar string?Avatar attachment ID of the sender
{
  "type": "FRIEND_REQUEST_CREATE",
  "data": {
    "id": "019cf96a-f1b5-72c5-830f-75e85355db00",
    "sender_id": "019cf96a-3d5b-72c5-830f-75e85355d078",
    "username": "MARCROCK22",
    "alias": null,
    "avatar": "9bd6da82-c850-424b-89a0-9e4733263a45"
  }
}

FRIEND_REQUEST_ACCEPT

EVENT FRIEND_REQUEST_ACCEPT

Sent when a friend request is accepted and a new friendship is established: to the user who sent the request, and to the sessions of the user who accepted it (that request also returns the new Friend object).

FieldTypeDescription
id stringFriendship ID
request_id stringOriginal friend request ID
sender_id stringID of the user who sent the original request
recipient_id stringID of the user who accepted the request
user ?UserThe other party in the friendship, from the receiver's side: the user who accepted for the sender, the sender for the user who accepted
{
  "type": "FRIEND_REQUEST_ACCEPT",
  "data": {
    "id": "019cf96a-02c6-72c5-830f-75e85355dc00",
    "request_id": "019cf96a-f1b5-72c5-830f-75e85355db00",
    "sender_id": "019cf96a-3d5b-72c5-830f-75e85355d078",
    "recipient_id": "019cf96a-13d7-72c5-830f-75e85355dd00",
    "user": {
      "id": "019cf96a-13d7-72c5-830f-75e85355dd00",
      "username": "MARCROCK22",
      "alias": null,
      "avatar": "9bd6da82-c850-424b-89a0-9e4733263a45",
      "banner": null,
      "custom": "",
      "flags": 1,
      "badges": 1,
      "is_bot": false,
      "email_verified": true,
      "created_at": "2025-10-30T00:22:21.000Z",
      "updated_at": "2026-04-06T12:00:00.000Z",
      "deleted_at": null
    }
  }
}

FRIEND_REQUEST_REJECT

EVENT FRIEND_REQUEST_REJECT

Sent to both the sender and the recipient when a friend request ends without a friendship: the recipient rejected it or the sender cancelled it.

FieldTypeDescription
id stringFriend request ID
{
  "type": "FRIEND_REQUEST_REJECT",
  "data": {
    "id": "019cf96a-f1b5-72c5-830f-75e85355db00"
  }
}

FRIEND_REMOVE

EVENT FRIEND_REMOVE

Sent to both users when a friendship is removed: to the removed friend, and to the sessions of the user who removed it.

FieldTypeDescription
user_id stringID of the other user in the friendship, from the receiver's side: the one who removed it for the removed friend, the removed friend for the one who removed it
{
  "type": "FRIEND_REMOVE",
  "data": {
    "user_id": "019cf96a-3d5b-72c5-830f-75e85355d078"
  }
}