Skip to main content

Endpoint

GET /api/check_follow
Check whether the authenticated user is currently following a target user.

Headers

Authorization
string
required
User authentication token received from login

Query parameters

username
string
required
Username of the target user to check follow status for

Response

is_following
boolean
true if the authenticated user follows the target user, false otherwise
error
string
Error message if the request failed

Status codes

  • 200: Successfully checked follow status
  • 400: Missing fields (username or token)
  • 401: Unauthorized (invalid token)

Example request

curl -X GET "https://api.example.com/api/check_follow?username=johndoe" \
  -H "Authorization: your-token-here"

Example responses

{
  "is_following": true
}

Notes

  • This endpoint does not verify if the target user exists
  • Returns false if the target user doesn’t exist or isn’t followed
  • Useful for UI state management (showing follow/unfollow buttons)

Build docs developers (and LLMs) love