Skip to content

Posts a comment or a threaded reply on a feed item, renders its Markdown, links any attached media and bumps the post comment count.

Either comment text or a media attachment is required; text is capped at 10 000 characters by default. Pass parent_id to reply, which must reference a comment on the same post. An identical comment by the same user on the same post is rejected as a duplicate. Mentions are parsed and recorded so the mentioned members are notified. Where content moderation holds the comment, the response carries the resulting status instead of a success message.

Endpoint

  • Method: POST

  • Path: /feeds/{feed_id}/comments

  • Edition: Core

  • Controller: CommentsController@store

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

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

  • Requires the can_comment permission in the space, and fails when the post author has disabled comments or the course has comments switched off.

  • Fires fluent_community/comment_added, which is what sends reply and mention notifications.

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 Create Comment

POST
/feeds/{feed_id}/comments

Posts a comment or a threaded reply on a feed item, renders its Markdown, links any attached media and bumps the post comment count.

Controller: CommentsController@store
Route source: fluent-community/app/Http/Routes/api.php:53

Authorizations

ApplicationPasswords

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

Type
API Key (header: Authorization)

Parameters

Path Parameters

feed_id*

Feed ID extracted from the URL path.

Type
integer
Required

Request Body

application/json
JSON
{
  
"comment": "string"
}

Responses

Successful response

application/json
JSON
{
  
"comment": {
  
  
"created_at": "string",
  
  
"id": 0,
  
  
"media": "string",
  
  
"message": "string",
  
  
"message_rendered": "string",
  
  
"meta": [
  
  
  
{
  
  
  
  
"additionalProperties": "string"
  
  
  
}
  
  
],
  
  
"post_id": 0,
  
  
"status": "string",
  
  
"type": "string",
  
  
"updated_at": "string",
  
  
"user_id": 0,
  
  
"xprofile": {
  
  
  
"avatar": "string",
  
  
  
"badge": "string",
  
  
  
"created_at": "string",
  
  
  
"display_name": "string",
  
  
  
"is_verified": 0,
  
  
  
"last_activity": "string",
  
  
  
"meta": {
  
  
  
  
"badge_slug": "string",
  
  
  
  
"cover_photo": "string",
  
  
  
  
"social_links": {
  
  
  
  
  
"fb": "string",
  
  
  
  
  
"instagram": "string",
  
  
  
  
  
"linkedin": "string",
  
  
  
  
  
"twitter": "string",
  
  
  
  
  
"youtube": "string"
  
  
  
  
},
  
  
  
  
"website": "string"
  
  
  
},
  
  
  
"permalink": "string",
  
  
  
"short_description": "string",
  
  
  
"status": "string",
  
  
  
"total_points": 0,
  
  
  
"user_id": 0,
  
  
  
"username": "string"
  
  
}
  
},
  
"message": "string"
}

Playground

Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation