Skip to content

Follows the named member if not already followed, and unfollows them if they are — addressed by numeric user id rather than username.

A blocked relationship cannot be toggled; unblock first. The response message tells you which way the toggle went.

Endpoint

  • Method: POST

  • Path: /profile/{userId}/toggle-follow

  • Edition: PRO

  • Controller: FollowController@toggleFollow

  • Route source: fluent-community-pro/app/Http/Routes/api.php:133

  • Controller source: fluent-community-pro/app/Http/Controllers/FollowController.php

  • Requires FluentCommunity Pro with the followers_module feature enabled.

Live sample

The request and response below were recorded against a running FluentCommunity install and then anonymised — member names, emails, avatars and post content are fictional, and long collections are trimmed to a few entries.

POST Toggle Profile Follow

POST
/profile/{userId}/toggle-follow

Follows the named member if not already followed, and unfollows them if they are — addressed by numeric user id rather than username.

Controller: FollowController@toggleFollow
Route source: fluent-community-pro/app/Http/Routes/api.php:133

Authorizations

ApplicationPasswords

WordPress Application Passwords — use Basic auth with username:application_password.

Type
API Key (header: Authorization)

Parameters

Path Parameters

userId*

UserId extracted from the URL path.

Type
integer
Required

Responses

Successful response

application/json
JSON
{
  
"follow": {
  
  
"created_at": "string",
  
  
"followed_id": 0,
  
  
"follower_id": 0,
  
  
"id": 0,
  
  
"level": 0,
  
  
"updated_at": "string"
  
},
  
"message": "string",
  
"xprofile": {
  
  
"avatar": "string",
  
  
"badge": "string",
  
  
"created_at": "string",
  
  
"display_name": "string",
  
  
"id": "string",
  
  
"is_verified": 0,
  
  
"last_activity": "string",
  
  
"meta": {
  
  
  
"cover_photo": "string",
  
  
  
"short_description_rendered": "string",
  
  
  
"website": "string"
  
  
},
  
  
"permalink": "string",
  
  
"short_description": "string",
  
  
"status": "string",
  
  
"total_points": 0,
  
  
"updated_at": "string",
  
  
"user_id": 0,
  
  
"username": "string"
  
}
}

Playground

Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation