cURL
curl --request POST \ --url https://api.example.com/follow/toggle \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-API-KEY: <x-api-key>' \ --data ' { "targetUserId": 123, "currentFollowing": true } '
{ "success": true, "message": "<string>", "action": "followed" }
Follows or unfollows a user based on the current follow status.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
API key required for authentication
ID of the user to follow or unfollow
Current follow status of the target user
Follow status updated successfully
followed
unfollowed