> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Post Event Comment

> Posts a new comment (and optional rating) on a published event on behalf of the authenticated customer.

# Post Event Comment

Submits a new comment and optional star rating on a published event. Only available when the event's `AllowComments` flag is `true`. After a successful post the event detail data should be refetched to display the new comment.

<Note>This endpoint uses the `/en/` legacy route prefix rather than `/api/public/`.</Note>

## Authentication

Requires a valid customer bearer token.

## Request Body

<ParamField body="Id" type="number" required>
  The integer ID of the event to comment on. Obtained as `Event.Id` from `GET /api/public/events/{id}`.
</ParamField>

<ParamField body="comment" type="string" required>
  The text body of the comment.
</ParamField>

<ParamField body="Title" type="string">
  Optional title or headline for the comment.
</ParamField>

<ParamField body="Rating" type="number | null">
  Optional numeric rating (e.g. `1`–`5`). Pass `null` to submit without a rating.
</ParamField>

## Response

Returns an empty `200 OK` on success. Refetch `GET /api/public/events/{id}` to see the new comment in the `Event.Comments` array.

## Examples

### Post a comment with a rating

```http theme={null}
POST /en/events/newComment
Authorization: Bearer {token}
Content-Type: application/json

{
  "Id": 412,
  "comment": "Fantastic session, highly recommend to anyone looking to start their week right!",
  "Title": "Great yoga class",
  "Rating": 5
}
```

```
HTTP/1.1 200 OK
```

### Post a comment without a rating

```http theme={null}
POST /en/events/newComment
Authorization: Bearer {token}
Content-Type: application/json

{
  "Id": 412,
  "comment": "Really enjoyed this. Will be back next week.",
  "Title": null,
  "Rating": null
}
```

```
HTTP/1.1 200 OK
```

## TypeScript Integration

```typescript theme={null}
import endpoints from '@/api/endpoints'

await httpClient.post(endpoints.events.newComment, {
  Id: 412,
  comment: 'Fantastic session, highly recommend!',
  Title: 'Great yoga class',
  Rating: 5,
})
```

## Usage in Portal

| Context                                         | Source file                        |
| ----------------------------------------------- | ---------------------------------- |
| Event detail page comment form (`/events/{id}`) | `src/views/events/details/data.ts` |

## Error Responses

<ResponseField name="401 Unauthorized" type="error">
  The customer is not authenticated or the session has expired.
</ResponseField>

<ResponseField name="400 Bad Request" type="error">
  Missing required field `Id` or `comment`, or the event does not allow comments (`AllowComments` is `false`).
</ResponseField>

<ResponseField name="404 Not Found" type="error">
  No event with the specified `Id` exists.
</ResponseField>

## Related Endpoints

| Method | Endpoint                   | Description                                                       |
| ------ | -------------------------- | ----------------------------------------------------------------- |
| `GET`  | `/api/public/events/{id}`  | Event detail — includes `Comments` array and `AllowComments` flag |
| `POST` | `/en/events/deleteComment` | Delete a comment previously posted by the customer                |
