---
title: "community.comment@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/community.comment"
updated: null
---

# community.comment@1 · OpenVibe.Services

HTML: [community.comment@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/community.comment)

# CommunityComment `community.comment@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

- Version: 1.0.0
- Owner: community
- Visibility: first-party
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/community/comment.v1.json`](/docs/contracts/community.comment.json)

community.comment@1: one comment in an embeddable comment thread on OpenVibe.Community (server/comments/service.js shapeComment), with its author (or anonymous name), score and the caller's vote, reply count and, for top-level comments in a page, the first two replies. A deleted comment keeps its place with no author or message.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `id` | integer | yes |  |  |
| `thread_id` | integer \| string | yes |  |  |
| `parent_id` | integer \| null | yes |  |  |
| `origin` | string | yes |  |  |
| `author` | object \| null | yes |  |  |
| `anon_name` | string \| null |  |  |  |
| `display_name` | string \| null |  |  |  |
| `message` | string \| null | yes |  | - `maxLength 5000` |
| `deleted` | boolean | yes |  |  |
| `score` | integer | yes |  |  |
| `upvotes` | integer |  |  | - `minimum 0` |
| `downvotes` | integer |  |  | - `minimum 0` |
| `my_vote` | enum | yes |  | - `one of 1, -1, 0` |
| `reply_count` | integer \| null |  |  |  |
| `created_at` | string \| null |  |  | - `format date-time` |
| `updated_at` | string \| null |  |  | - `format date-time` |
| `edited_at` | string \| null |  |  | - `format date-time` |
| `can_edit` | boolean | yes |  |  |
| `can_delete` | boolean | yes |  |  |
| `replies` | array of object |  |  |  |
| `reply_to_id` | integer \| null |  | The exact comment answered; parent\_id remains the top-level comment. |  |
| `reply_to` | object \| null |  |  |  |
| `attachments` | [ai.file](/docs/contracts/ai.file) |  |  | - `maxItems 4` |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: comment

~~~~
{
  "id": 812,
  "thread_id": "cth_Ab3dE5gH7jK9mN1pQ3sT5v",
  "parent_id": null,
  "origin": "user",
  "author": {
    "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "username": "alice",
    "display_name": "Alice",
    "avatar_url": null,
    "profile_color": null
  },
  "anon_name": null,
  "display_name": "Alice",
  "message": "That ending!",
  "deleted": false,
  "score": 2,
  "upvotes": 2,
  "downvotes": 0,
  "my_vote": 0,
  "reply_count": 0,
  "created_at": "2026-09-25T18:00:00.000Z",
  "updated_at": "2026-09-25T18:00:00.000Z",
  "edited_at": null,
  "can_edit": false,
  "can_delete": false
}
~~~~

Rejected: bad-vote

~~~~
{
  "id": 812,
  "thread_id": "cth_Ab3dE5gH7jK9mN1pQ3sT5v",
  "parent_id": null,
  "origin": "user",
  "author": {
    "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "username": "alice",
    "display_name": "Alice",
    "avatar_url": null,
    "profile_color": null
  },
  "anon_name": null,
  "display_name": "Alice",
  "message": "That ending!",
  "deleted": false,
  "score": 2,
  "upvotes": 2,
  "downvotes": 0,
  "my_vote": 5,
  "reply_count": 0,
  "created_at": "2026-09-25T18:00:00.000Z",
  "updated_at": "2026-09-25T18:00:00.000Z",
  "edited_at": null,
  "can_edit": false,
  "can_delete": false
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('community.comment@1', value);   // { valid, errors: [{ path, message }] }
~~~~
