React to a comment
POST
/posts/{post}/comments/{comment}/reactions
const url = 'https://feed.work.optidata.cloud/api/posts/2289/comments/1242/reactions';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"reaction":"like"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://feed.work.optidata.cloud/api/posts/2289/comments/1242/reactions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "reaction": "like" }'Adds or changes the caller’s reaction to the comment.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”post
required
integer
Numeric id of the post.
comment
required
integer
Numeric id of the comment.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
reaction
required
The reaction to apply. Currently like.
string
Examples
Exampleexample
{ "reaction": "like"}Responses
Section titled “ Responses ”The comment with the reaction counted.
Media typeapplication/json
A comment on a post.
object
id
required
integer
post_id
required
integer
user_id
required
integer
content
required
A JSON-encoded Quill delta.
string
meta
object | null
created_at
string format: date-time
updated_at
string format: date-time
deleted_at
string | null format: date-time
pinned_at
string | null format: date-time
reacting_users_count
integer
user
A user of the company.
object
id
required
integer
uuid
required
string format: uuid
cuid
Identifier of the company.
string
username
string
email
string
name
required
string | null
company_name
string | null
role
string
status
string | null
created_at
string format: date-time
updated_at
string format: date-time
deleted_at
string | null format: date-time
avatar_url
string | null
settings
object | null
Examples
Exampleexample
{ "id": 1242, "post_id": 2289, "user_id": 38, "content": "{\"ops\":[{\"insert\":\"Great news!\\n\"}]}", "meta": null, "created_at": "2026-10-19T14:38:34.000000Z", "updated_at": "2026-10-19T14:38:34.000000Z", "deleted_at": null, "pinned_at": null, "reacting_users_count": 0, "reaction_summary": { "like": 1 }, "user": { "id": 38, "uuid": "9ba64b0e-69b4-4639-a01b-4ac5c5f70a24", "cuid": "7f3c2a10-5b8e-4d21-9c6a-0e4f1b2d3c4a", "username": "ana.souza@example.com", "email": "ana.souza@example.com", "name": "Ana Souza", "company_name": "Acme", "role": "user", "status": "active", "created_at": "2026-03-25T19:47:41.000000Z", "updated_at": "2026-09-16T17:25:41.000000Z", "deleted_at": null, "avatar_url": "https://media.optidata.cloud/avatars/ana.webp", "settings": { "language": "pt_BR", "language_source": "company", "theme": "light", "timezone": null, "user_id": 214 } }}No authentication key was sent.
Media typeapplication/json
Authentication failures use an error key.
object
error
required
string
Examples
Exampleexample
{ "error": "JWT passport exception: Missing bearer token in request"}The caller is not allowed to perform this action.
Media typeapplication/json
object
message
required
string
Examples
Exampleexample
{ "message": "This action is unauthorized."}No matching resource, or it is not reachable through this path.
Media typeapplication/json
object
message
required
string
Examples
Exampleexample
{ "message": "No query results for model [App\\Models\\Category] 864"}The authentication key is expired or not recognised. Get a fresh one and retry.
Media typeapplication/json
Authentication failures use an error key.
object
error
required
string
Examples
Exampleexample
{ "error": "JWT passport expired: Passport expired"}The request failed validation.
Media typeapplication/json
object
message
required
The first validation message.
string
errors
required
Messages keyed by field name.
object
key
additional properties
Array<string>
Examples
Exampleexample
{ "message": "The name field is required.", "errors": { "name": [ "The name field is required." ] }}