Skip to main content

Endpoint

POST /api/users/{username}/close-friends

Authentication

This endpoint requires authentication.

Path Parameters

username
string
required
The username of the user to add to close friends

Request Body

userName
string
required
The username of the account initiating the add action

Request Example

curl -X POST https://api.example.com/api/users/johndoe/close-friends \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "userName": "yourUsername"
  }'

Response

status
number
Returns 204 No Content on successful addition

CloseFriend Object

The add action creates a CloseFriend record with a composite key:
AddingUserID
integer
The user ID of the account initiating the add action
CloseFriendAccountId
integer
The user ID of the close friend account

Error Responses

404 Not Found
error
  • "This account does not exist" - The initiating account was not found
  • "This user does not exist" - The target username was not found
403 Forbidden
error
Returned when attempting to add yourself to close friends
409 Conflict
error
"Account already added this user." - The user is already in your close friends list

Build docs developers (and LLMs) love