> For the complete documentation index, see [llms.txt](https://docs.truedat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.truedat.io/v8.8/api-integrations/business-glossary-apis/comments.md).

# Comments

## List comments

> Retrieve a list of comments, optionally filtered by resource ID and resource type.

```json
{"openapi":"3.0.0","info":{"title":"td-bg","version":"Truedat 8.8.0"},"paths":{"/api/business_concepts/comments":{"get":{"description":"Retrieve a list of comments, optionally filtered by resource ID and resource type.","operationId":"TdBgWeb.CommentController.index","parameters":[{"description":"Filter by resource id","in":"query","name":"resource_id","required":false,"schema":{"type":"string"}},{"description":"Filter by resource type","in":"query","name":"resource_type","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentIndexResponse"}}},"description":"Comments list"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgUnauthorizedResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgUnprocessableEntityArrayResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List comments","tags":["Comments"]}}},"components":{"schemas":{"CommentIndexResponse":{"additionalProperties":false,"properties":{"data":{"description":"List of comments","items":{"$ref":"#/components/schemas/Comment"},"type":"array"}},"required":["data"],"title":"CommentIndexResponse","type":"object"},"Comment":{"additionalProperties":false,"properties":{"content":{"description":"Comment content","type":"string"},"created_at":{"description":"Creation timestamp","format":"date-time","nullable":true,"type":"string"},"id":{"description":"Comment ID","type":"integer"},"resource_id":{"description":"ID of the resource being commented","type":"integer"},"resource_type":{"description":"Type of the resource (e.g., business_concept)","type":"string"},"user":{"$ref":"#/components/schemas/CommentUser"}},"required":["id","resource_id","resource_type","content","user"],"title":"Comment","type":"object"},"CommentUser":{"additionalProperties":false,"properties":{"full_name":{"description":"User full name","type":"string"},"user_id":{"description":"User ID","type":"integer"},"user_name":{"description":"User name","type":"string"}},"required":["user_id","user_name"],"title":"CommentUser","type":"object"},"TdBgUnauthorizedResponse":{"properties":{"errors":{"properties":{"message":{"type":"string"}},"type":"object"}},"title":"TdBgUnauthorizedResponse","type":"object"},"TdBgUnprocessableEntityArrayResponse":{"properties":{"errors":{"items":{"properties":{"code":{"type":"string"},"name":{"type":"string"}},"type":"object"},"type":"array"}},"title":"TdBgUnprocessableEntityArrayResponse","type":"object"},"TdBgInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdBgInternalServerErrorResponse","type":"object"}}}}
```

## Create comment

> Create a new comment for a resource using the provided payload.

```json
{"openapi":"3.0.0","info":{"title":"td-bg","version":"Truedat 8.8.0"},"paths":{"/api/business_concepts/comments":{"post":{"description":"Create a new comment for a resource using the provided payload.","operationId":"TdBgWeb.CommentController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentCreateRequest"}}},"description":"Comment payload","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentCreateResponse"}}},"description":"Comment created"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgUnauthorizedResponse"}}},"description":"Unauthorized"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgUnprocessableEntityObjectResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create comment","tags":["Comments"]}}},"components":{"schemas":{"CommentCreateRequest":{"additionalProperties":false,"properties":{"comment":{"additionalProperties":false,"properties":{"content":{"type":"string"},"resource_id":{"type":"integer"},"resource_type":{"type":"string"}},"required":["resource_id","resource_type","content"],"type":"object"}},"required":["comment"],"title":"CommentCreateRequest","type":"object"},"CommentCreateResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Comment"}},"required":["data"],"title":"CommentCreateResponse","type":"object"},"Comment":{"additionalProperties":false,"properties":{"content":{"description":"Comment content","type":"string"},"created_at":{"description":"Creation timestamp","format":"date-time","nullable":true,"type":"string"},"id":{"description":"Comment ID","type":"integer"},"resource_id":{"description":"ID of the resource being commented","type":"integer"},"resource_type":{"description":"Type of the resource (e.g., business_concept)","type":"string"},"user":{"$ref":"#/components/schemas/CommentUser"}},"required":["id","resource_id","resource_type","content","user"],"title":"Comment","type":"object"},"CommentUser":{"additionalProperties":false,"properties":{"full_name":{"description":"User full name","type":"string"},"user_id":{"description":"User ID","type":"integer"},"user_name":{"description":"User name","type":"string"}},"required":["user_id","user_name"],"title":"CommentUser","type":"object"},"TdBgUnauthorizedResponse":{"properties":{"errors":{"properties":{"message":{"type":"string"}},"type":"object"}},"title":"TdBgUnauthorizedResponse","type":"object"},"TdBgUnprocessableEntityObjectResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdBgUnprocessableEntityObjectResponse","type":"object"},"TdBgInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdBgInternalServerErrorResponse","type":"object"}}}}
```

## Get comment by id

> Retrieve a single comment by its ID.

```json
{"openapi":"3.0.0","info":{"title":"td-bg","version":"Truedat 8.8.0"},"paths":{"/api/business_concepts/comments/{id}":{"get":{"description":"Retrieve a single comment by its ID.","operationId":"TdBgWeb.CommentController.show","parameters":[{"description":"Comment ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentShowResponse"}}},"description":"Comment"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgUnauthorizedResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgNotFoundResponse"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Get comment by id","tags":["Comments"]}}},"components":{"schemas":{"CommentShowResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Comment"}},"required":["data"],"title":"CommentShowResponse","type":"object"},"Comment":{"additionalProperties":false,"properties":{"content":{"description":"Comment content","type":"string"},"created_at":{"description":"Creation timestamp","format":"date-time","nullable":true,"type":"string"},"id":{"description":"Comment ID","type":"integer"},"resource_id":{"description":"ID of the resource being commented","type":"integer"},"resource_type":{"description":"Type of the resource (e.g., business_concept)","type":"string"},"user":{"$ref":"#/components/schemas/CommentUser"}},"required":["id","resource_id","resource_type","content","user"],"title":"Comment","type":"object"},"CommentUser":{"additionalProperties":false,"properties":{"full_name":{"description":"User full name","type":"string"},"user_id":{"description":"User ID","type":"integer"},"user_name":{"description":"User name","type":"string"}},"required":["user_id","user_name"],"title":"CommentUser","type":"object"},"TdBgUnauthorizedResponse":{"properties":{"errors":{"properties":{"message":{"type":"string"}},"type":"object"}},"title":"TdBgUnauthorizedResponse","type":"object"},"TdBgNotFoundResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdBgNotFoundResponse","type":"object"},"TdBgInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdBgInternalServerErrorResponse","type":"object"}}}}
```

## Delete comment

> Delete the specified comment by its ID.

```json
{"openapi":"3.0.0","info":{"title":"td-bg","version":"Truedat 8.8.0"},"paths":{"/api/business_concepts/comments/{id}":{"delete":{"description":"Delete the specified comment by its ID.","operationId":"TdBgWeb.CommentController.delete","parameters":[{"description":"Comment ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Comment deleted"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgUnauthorizedResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgNotFoundResponse"}}},"description":"Not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdBgInternalServerErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Delete comment","tags":["Comments"]}}},"components":{"schemas":{"TdBgUnauthorizedResponse":{"properties":{"errors":{"properties":{"message":{"type":"string"}},"type":"object"}},"title":"TdBgUnauthorizedResponse","type":"object"},"TdBgNotFoundResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdBgNotFoundResponse","type":"object"},"TdBgInternalServerErrorResponse":{"properties":{"errors":{"properties":{"detail":{"type":"string"}},"type":"object"}},"title":"TdBgInternalServerErrorResponse","type":"object"}}}}
```
