Endpoint
Authentication
This endpoint requires authentication.Path Parameters
The username of the user to follow
Request Body
The username of the authenticated user initiating the follow action
Response
204 No Content on successful follow
Response Details
When a user successfully follows another user:- A Follow record is created with a composite key (FollowerID, FollowedUserID)
- The followed user’s
FollowersCountis incremented - The follower’s
FollowingCountis incremented - A notification is triggered for the followed user
- The composite key prevents duplicate follows in the database
Request Example
cURL
Error Responses
Bad Request - Invalid request format
Not Found - User does not exist or action cannot be completed due to a block
Conflict - Account already follows this user
Error Scenarios
- 404 Not Found: Returned when the initiating account doesn’t exist, the target user doesn’t exist, or when the action cannot be completed due to a block between users
- 409 Conflict: Returned when the user is already following the target user
- 403 Forbidden: Returned when a user attempts to follow themselves