> For the complete documentation index, see [llms.txt](https://docs.api.intratool.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.api.intratool.de/api-reference/infoboard/infoboard-comments.md).

# InfoboardComments

## Introduction

`InfoboardComments` provide discussion on an [InfoboardPost](/api-reference/infoboard/infoboard-posts.md). Their visibility always depends on the parent post and can be narrowed by a comment-specific visibility constraint.

Comment author metadata is derived from the authenticated identity and can account for temporary authentication and group-account confirmation.

The `text` field uses the shared [Rich Text](/introduction/rich-text.md) HTML format.

## Model Definition

**Alias**

`infoboardComment`

**Relations**

| Key               | Relation                                                     | Type       | Relation Field(s)                                                         |
| ----------------- | ------------------------------------------------------------ | ---------- | ------------------------------------------------------------------------- |
| `user`            | [User](/api-reference/users.md)                              | Belongs to | `user_id`                                                                 |
| `post`            | [InfoboardPost](/api-reference/infoboard/infoboard-posts.md) | Belongs to | `post_id`                                                                 |
| `reactions`       | [Reactions](/api-reference/reactions.md)                     | Morph many | `reactions.reactable_type`, `reactions.reactable_id`                      |
| `currentReaction` | [Reaction](/api-reference/reactions.md)                      | Morph one  | `reactions.reactable_type`, `reactions.reactable_id`, `reactions.user_id` |

**Visibility constraint types**

* `department` - Limit the comment to the author's department.
* `private` - Limit the comment to users with the applicable private-comment access and allowed department context.
* `null` - Do not impose a comment-specific visibility constraint.

**Computed Properties**

* `hash` - Hashed representation of the comment `id`.

**Capabilities**

* [Targetables](/introduction/resource-capabilities/targetables.md) - Comments inherit visibility from the parent post's Targetables and do not accept independent assignment input.
* [Entity Permissions](/introduction/resource-capabilities/entity-permissions.md) - Comments inherit channel Entity Permissions through their parent post and do not own independent grants.
* [URL Context](/introduction/resource-capabilities/url-context.md) - Comment URLs resolve to access-checked context information.
* [Translations](/introduction/resource-capabilities/translations.md) - The `text` field is translatable.
* [Notifications](/introduction/resource-capabilities/notifications.md) - Creating or changing comment text can notify eligible users connected to the parent post.
* [Reactions](/introduction/resource-capabilities/reactions.md) - Comments accept reactions when their parent post allows them.

## List

List `InfoboardComments` visible to the current authenticated [User](/api-reference/users.md).

**Definition**

<mark style="color:green;">`GET`</mark> `/api/infoboard/posts/comments`

**Behavior**

* A comment must be visible through its parent post and satisfy its own `visibility_constraint_type`.
* Comment owners, parent-post owners, and explicit entity grants can provide additional access where the applicable permission strategy allows it.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/infoboard/posts/comments', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 1,
    "user_id": 4,
    "group_account_user_id": null,
    "department_id": 1,
    "post_id": 1,
    "lang_id": "en-US",
    "text": "<p>Please add the recording after the town hall.</p>",
    "visibility_constraint_type": null,
    "created_at": "2026-08-06 10:00:00",
    "updated_at": "2026-08-06 10:00:00",
    "deleted_at": null,
    "hash": "x9v2km7q4n1pz6rd8ew5g0la"
  },
  {
    "id": 2,
    "user_id": 5,
    "group_account_user_id": null,
    "department_id": 2,
    "post_id": 1,
    "lang_id": "en-US",
    "text": "<p>The slides are available in the shared folder.</p>",
    "visibility_constraint_type": "department",
    "created_at": "2026-08-06 10:10:00",
    "updated_at": "2026-08-06 10:10:00",
    "deleted_at": null,
    "hash": "k4m8pz2q7v1nr5dx9e6w0yla"
  }
]
```

## List by Post

List visible `InfoboardComments` for one `InfoboardPost`.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/infoboard/posts/{infoboardPost}/comments`

**Route Parameters**

| Parameter       | Type                  | Description               |
| --------------- | --------------------- | ------------------------- |
| `infoboardPost` | `integer` \| `string` | InfoboardPost ID or hash. |

**Behavior**

* The parent post and every returned comment must be visible to the authenticated user.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/infoboard/posts/1/comments', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
[
  {
    "id": 1,
    "user_id": 4,
    "group_account_user_id": null,
    "department_id": 1,
    "post_id": 1,
    "lang_id": "en-US",
    "text": "<p>Please add the recording after the town hall.</p>",
    "visibility_constraint_type": null,
    "created_at": "2026-08-06 10:00:00",
    "updated_at": "2026-08-06 10:00:00",
    "deleted_at": null,
    "hash": "x9v2km7q4n1pz6rd8ew5g0la"
  },
  {
    "id": 2,
    "user_id": 5,
    "group_account_user_id": null,
    "department_id": 2,
    "post_id": 1,
    "lang_id": "en-US",
    "text": "<p>The slides are available in the shared folder.</p>",
    "visibility_constraint_type": "department",
    "created_at": "2026-08-06 10:10:00",
    "updated_at": "2026-08-06 10:10:00",
    "deleted_at": null,
    "hash": "k4m8pz2q7v1nr5dx9e6w0yla"
  }
]
```

## Show

Show one visible `InfoboardComment` by ID or hash.

**Definition**

<mark style="color:green;">`GET`</mark> `/api/infoboard/posts/comments/{infoboardComment}`

**Route Parameters**

| Parameter          | Type                  | Description                  |
| ------------------ | --------------------- | ---------------------------- |
| `infoboardComment` | `integer` \| `string` | InfoboardComment ID or hash. |

**Behavior**

* Parent-post visibility and the comment's visibility constraint both apply.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/infoboard/posts/comments/1', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "id": 1,
  "user_id": 4,
  "group_account_user_id": null,
  "department_id": 1,
  "post_id": 1,
  "lang_id": "en-US",
  "text": "<p>Please add the recording after the town hall.</p>",
  "visibility_constraint_type": null,
  "created_at": "2026-08-06 10:00:00",
  "updated_at": "2026-08-06 10:00:00",
  "deleted_at": null,
  "hash": "x9v2km7q4n1pz6rd8ew5g0la"
}
```

## Create

Create a new `InfoboardComment` for one `InfoboardPost`.

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/infoboard/posts/{infoboardPost}/comments`

**Route Parameters**

| Parameter       | Type                  | Description               |
| --------------- | --------------------- | ------------------------- |
| `infoboardPost` | `integer` \| `string` | InfoboardPost ID or hash. |

**Request Keys**

| Key                          | Type               | Default         | Description                                                            |
| ---------------------------- | ------------------ | --------------- | ---------------------------------------------------------------------- |
| `lang_id`                    | `string`           | system language | Language key for the translatable comment text.                        |
| `text`\*                     | `string`           | -               | Comment content, which can contain HTML.                               |
| `visibility_constraint_type` | `string` \| `null` | `null`          | [Visibility constraint](#visibility-constraint-types) for the comment. |

Keys with `*` are required.

**Behavior**

* The parent post must allow comments, and the authenticated real user must be permitted to comment on it.
* `post_id`, `department_id`, `user_id`, and `group_account_user_id` are derived from the route and authenticated identity; client-provided values are replaced.
* When the post requires user confirmation, the active confirmed user must be a non-group account. Otherwise the real authenticated user becomes the author.
* When the post forces its comment visibility constraint, the post's `comment_visibility_constraint_type` replaces the client value.
* Creating a comment can trigger notifications for eligible users connected to the parent post.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/infoboard/posts/1/comments', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'text' => '<p>Please add the recording after the town hall.</p>'
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 1,
    "user_id": 4,
    "group_account_user_id": null,
    "department_id": 1,
    "post_id": 1,
    "lang_id": "en-US",
    "text": "<p>Please add the recording after the town hall.</p>",
    "visibility_constraint_type": null,
    "created_at": "2026-08-06 10:00:00",
    "updated_at": "2026-08-06 10:00:00",
    "deleted_at": null,
    "hash": "x9v2km7q4n1pz6rd8ew5g0la"
  }
}
```

## Reset Relations

Reset selected dependent relations of an `InfoboardComment`.

**Definition**

<mark style="color:yellow;">`POST`</mark> `/api/infoboard/posts/comments/{infoboardComment}/reset`

**Route Parameters**

| Parameter          | Type                  | Description                  |
| ------------------ | --------------------- | ---------------------------- |
| `infoboardComment` | `integer` \| `string` | InfoboardComment ID or hash. |

**Request Keys**

| Key         | Type      | Default | Description                   |
| ----------- | --------- | ------- | ----------------------------- |
| `reactions` | `boolean` | `false` | Delete reactions when `true`. |

**Behavior**

* `reactions` must be `true`; otherwise no relation is reset and the operation returns an error response.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/infoboard/posts/comments/1/reset', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'reactions' => true
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 1,
    "user_id": 4,
    "group_account_user_id": null,
    "department_id": 1,
    "post_id": 1,
    "lang_id": "en-US",
    "text": "<p>Please add the recording after the town hall.</p>",
    "visibility_constraint_type": null,
    "created_at": "2026-08-06 10:00:00",
    "updated_at": "2026-08-06 10:00:00",
    "deleted_at": null,
    "hash": "x9v2km7q4n1pz6rd8ew5g0la"
  }
}
```

## Update

Update an existing `InfoboardComment`.

**Definition**

<mark style="color:blue;">`PUT`</mark> `/api/infoboard/posts/comments/{infoboardComment}`

**Route Parameters**

| Parameter          | Type                  | Description                  |
| ------------------ | --------------------- | ---------------------------- |
| `infoboardComment` | `integer` \| `string` | InfoboardComment ID or hash. |

**Request Keys**

| Key                          | Type               | Description                                                            |
| ---------------------------- | ------------------ | ---------------------------------------------------------------------- |
| `lang_id`                    | `string`           | Language key for the translatable comment text.                        |
| `text`                       | `string`           | Comment content, which can contain HTML.                               |
| `visibility_constraint_type` | `string` \| `null` | [Visibility constraint](#visibility-constraint-types) for the comment. |

**Behavior**

* `post_id` cannot be changed. Client-provided author and department fields are removed.
* Changing `text` updates `user_id`, `group_account_user_id`, and `department_id` from the authenticated identity and can trigger updated-comment notifications.
* Changing `text` removes its stored translations.
* `visibility_constraint_type` cannot be changed while the parent post forces its configured comment constraint.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/infoboard/posts/comments/1', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'text' => '<p>Please add the recording and slides after the town hall.</p>'
    ]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": {
    "id": 1,
    "user_id": 4,
    "group_account_user_id": null,
    "department_id": 1,
    "post_id": 1,
    "lang_id": "en-US",
    "text": "<p>Please add the recording and slides after the town hall.</p>",
    "visibility_constraint_type": null,
    "created_at": "2026-08-06 10:00:00",
    "updated_at": "2026-08-06 10:15:00",
    "deleted_at": null,
    "hash": "x9v2km7q4n1pz6rd8ew5g0la"
  }
}
```

## Delete

Delete an existing `InfoboardComment`.

**Definition**

<mark style="color:red;">`DELETE`</mark> `/api/infoboard/posts/comments/{infoboardComment}`

**Route Parameters**

| Parameter          | Type                  | Description                  |
| ------------------ | --------------------- | ---------------------------- |
| `infoboardComment` | `integer` \| `string` | InfoboardComment ID or hash. |

**Behavior**

* The comment is soft-deleted, and notifications targeting it are deleted.
* When the parent post does not require user confirmation, authorization uses the real authenticated user rather than a leftover temporary identity.

**Example Request**

{% tabs %}
{% tab title="PHP" %}

```php
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('DELETE', '/api/infoboard/posts/comments/1', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
```

{% endtab %}
{% endtabs %}

**Example Response**

```json
{
  "status": "success",
  "data": null
}
```
