# Comment & Mention Endpoints {#comment--mention-endpoints}


Manage comments, @mentions, and reactions on entities (tasks, projects, etc.).


## Base Paths {#base-paths}


| Resource  | Path            |
| --------- | --------------- |
| Comments  | `/api/comment`  |
| Mentions  | `/api/mention`  |
| Reactions | `/api/reaction` |


## Comment Endpoints {#comment-endpoints}



### List Comments {#list-comments}


```
GET /api/comment
Authorization: Bearer {token}
```

**Query Parameters:**

| Parameter   | Type   | Description                           |
| ----------- | ------ | ------------------------------------- |
| `entity`    | string | Entity type (e.g., `Task`, `Project`) |
| `entityId`  | string | ID of the parent entity               |
| `relations` | array  | Relations to include                  |


### Get Comment by ID {#get-comment-by-id}


```
GET /api/comment/:id
Authorization: Bearer {token}
```


### Create Comment {#create-comment}


```
POST /api/comment
Authorization: Bearer {token}
Content-Type: application/json

{
  "entity": "Task",
  "entityId": "task-uuid",
  "comment": "This looks great! Let's proceed with the implementation.",
  "members": ["employee-uuid-1"],
  "parentId": null
}
```

**Response** `201 Created`.


### Update Comment {#update-comment}


```
PUT /api/comment/:id
Authorization: Bearer {token}
Content-Type: application/json

{
  "comment": "Updated comment text",
  "editedAt": "2024-03-15T10:00:00.000Z"
}
```


### Delete Comment {#delete-comment}


```
DELETE /api/comment/:id
Authorization: Bearer {token}
```


## Mention Endpoints {#mention-endpoints}



### List Mentions {#list-mentions}


```
GET /api/mention
Authorization: Bearer {token}
```


### Create Mention {#create-mention}


```
POST /api/mention
Authorization: Bearer {token}
Content-Type: application/json

{
  "entityId": "comment-uuid",
  "entity": "Comment",
  "mentionedUserId": "user-uuid"
}
```


## Reaction Endpoints {#reaction-endpoints}



### List Reactions {#list-reactions}


```
GET /api/reaction
Authorization: Bearer {token}
```


### Add Reaction {#add-reaction}


```
POST /api/reaction
Authorization: Bearer {token}
Content-Type: application/json

{
  "entity": "Comment",
  "entityId": "comment-uuid",
  "emoji": "👍"
}
```


### Remove Reaction {#remove-reaction}


```
DELETE /api/reaction/:id
Authorization: Bearer {token}
```


## Data Model {#data-model}


```typescript
interface IComment {
  id: string;
  entity: string;
  entityId: string;
  comment: string;
  actorType?: ActorTypeEnum;
  resolved?: boolean;
  resolvedAt?: Date;
  editedAt?: Date;

  // Relations
  parentId?: string;
  parent?: IComment;
  replies?: IComment[];
  members?: IEmployee[];
  creatorId?: string;
  tenantId: string;
  organizationId: string;
}

interface IMention {
  id: string;
  entityId: string;
  entity: string;
  mentionedUserId: string;
  mentionById?: string;
  parentEntityId?: string;
  parentEntityType?: string;
}

interface IReaction {
  id: string;
  entity: string;
  entityId: string;
  emoji: string;
  creatorId: string;
}
```


## Related Pages {#related-pages}


- [Comments & Mentions Feature](https://sourcey-gauzy.pages.dev/features/comments-and-mentions/index.md) — feature guide
- [Reactions Feature](https://sourcey-gauzy.pages.dev/features/reactions/index.md) — emoji reactions
- [Task Endpoints](https://sourcey-gauzy.pages.dev/api/task-endpoints/index.md) — tasks with comments
