> For the complete documentation index, see [llms.txt](https://dev.guardian.hedera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.guardian.hedera.com/static-spec-test/guardian-policies/comments.md).

# Comments

## Returns the list of user names which are present in the target policy and have access to the target document.

> Returns the list of user names which are present in the target policy and have access to the target document.

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-comments"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"PolicyCommentUserDTO":{"type":"object","properties":{"label":{"type":"string","description":"Display name (username for users, role name for roles, \"All\" for broadcast)"},"value":{"type":"string","description":"Value to use when targeting (DID for users, role name for roles, \"all\" for broadcast)"},"type":{"type":"string","description":"Entry type: \"all\" = broadcast to everyone, \"role\" = target by role, \"user\" = target specific user","enum":["all","role","user"]},"roles":{"description":"List of roles assigned to this user (only present when type = \"user\")","type":"array","items":{"type":"string"}}},"required":["label","value","type"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"UnprocessableEntityErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/policy-comments/{policyId}/{documentId}/users":{"get":{"description":"Returns the list of user names which are present in the target policy and have access to the target document.","operationId":"PolicyCommentsApi_getUsers","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy Id","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document Identifier","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation. Returns mix of broadcast target (\"all\"), role targets, and individual user targets with their roles.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PolicyCommentUserDTO"}}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"422":{"description":"Unprocessable entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Returns the list of user names which are present in the target policy and have access to the target document.","tags":["policy-comments"]}}}}
```

## Returns the list of documents linked with the target document

> Returns the list of documents linked with the target document

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-comments"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"PolicyCommentRelationshipDTO":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"UnprocessableEntityErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/policy-comments/{policyId}/{documentId}/relationships":{"get":{"description":"Returns the list of documents linked with the target document","operationId":"PolicyCommentsApi_getRelationships","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy Id","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document Identifier","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PolicyCommentRelationshipDTO"}}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"422":{"description":"Unprocessable entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Returns the list of documents linked with the target document","tags":["policy-comments"]}}}}
```

## Returns the list of schemas for the target document

> Returns the list of schemas for the target document

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-comments"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SchemaDTO":{"type":"object","properties":{"createDate":{"type":"string","nullable":true},"updateDate":{"type":"string","nullable":true},"id":{"type":"string"},"uuid":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"entity":{"type":"string","enum":["NONE","VC","EVC","STANDARD_REGISTRY","USER","POLICY","MINT_TOKEN","INTEGRATION_DATA_V2","RETIRE","WIPE_TOKEN","MINT_NFTOKEN","ISSUER","USER_ROLE","CHUNK","ACTIVITY_IMPACT","TOKEN_DATA_SOURCE","ROLE","USER_PERMISSIONS","POLICY_DISCUSSION_V2","POLICY_COMMENT","POLICY_EXPORT_PROOF","EVIDENCE_ATTACHMENTS"]},"iri":{"type":"string"},"status":{"type":"string","enum":["DRAFT","PUBLISHED","UNPUBLISHED","ERROR","DEMO","VIEW"]},"topicId":{"type":"string"},"version":{"type":"string"},"creator":{"type":"string","nullable":true},"owner":{"type":"string"},"messageId":{"type":"string","nullable":true},"category":{"type":"string","enum":["POLICY","MODULE","SYSTEM","TAG","TOOL","STATISTIC","LABEL"]},"documentURL":{"type":"string"},"contextURL":{"type":"string"},"document":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"string"}]},"context":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"string"}]},"readonly":{"type":"boolean","nullable":true},"system":{"type":"boolean","nullable":true},"active":{"type":"boolean","nullable":true},"codeVersion":{"type":"string","nullable":true},"topicCount":{"type":"number","nullable":true}},"required":["id","uuid","name","description","entity","iri","status","topicId","version","owner","category","documentURL","contextURL","document","context"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"UnprocessableEntityErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/policy-comments/{policyId}/{documentId}/schemas":{"get":{"description":"Returns the list of schemas for the target document","operationId":"PolicyCommentsApi_getSchemas","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy Id","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document Identifier","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SchemaDTO"}}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"422":{"description":"Unprocessable entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Returns the list of schemas for the target document","tags":["policy-comments"]}}}}
```

## Returns the list of discussions for the target document

> Returns the list of discussions for the target document

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-comments"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"PolicyDiscussionDTO":{"type":"object","properties":{"id":{"type":"string"},"uuid":{"type":"string"},"creator":{"type":"string"},"owner":{"type":"string"},"policyId":{"type":"string"},"target":{"type":"string"},"targetId":{"type":"string"},"messageId":{"type":"string"},"parent":{"type":"string"},"hash":{"type":"string"},"name":{"type":"string"},"field":{"type":"string"},"fieldName":{"type":"string"},"relationships":{"type":"array","items":{"type":"string"}},"relationshipIds":{"type":"array","items":{"type":"string"}},"privacy":{"type":"string","enum":["public","roles","users"]},"roles":{"type":"array","items":{"type":"string"}},"users":{"type":"array","items":{"type":"string"}},"system":{"type":"boolean"},"count":{"type":"number","description":"Number of comments in this discussion"},"document":{"nullable":false,"allOf":[{"$ref":"#/components/schemas/VcDTO"}]},"historyIds":{"description":"Array of document IDs that form the history chain for this discussion target (added by API for GET /discussions)","type":"array","items":{"type":"string"}}},"required":["id","document"]},"VcDTO":{"type":"object","properties":{"id":{"type":"string","nullable":true},"@context":{"type":"array","items":{"type":"string"}},"type":{"type":"array","items":{"type":"string"}},"credentialSubject":{"additionalProperties":true,"type":"array","items":{"type":"object"}},"issuer":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"issuanceDate":{"type":"string"},"proof":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/ProofDTO"}]}},"required":["id","@context","type","credentialSubject","issuer","issuanceDate","proof"]},"ProofDTO":{"type":"object","properties":{"type":{"type":"string"},"created":{"type":"string"},"verificationMethod":{"type":"string"},"proofPurpose":{"type":"string"},"jws":{"type":"string"}},"required":["type","created","verificationMethod","proofPurpose","jws"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"UnprocessableEntityErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/policy-comments/{policyId}/{documentId}/discussions":{"get":{"description":"Returns the list of discussions for the target document","operationId":"PolicyCommentsApi_getDiscussions","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy Id","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document Identifier","schema":{"type":"string"}},{"name":"search","required":false,"in":"query","description":"Text","schema":{"type":"string"}},{"name":"field","required":false,"in":"query","description":"Field path","schema":{"type":"string"}},{"name":"readonly","required":false,"in":"query","description":"When true and user has POLICIES_POLICY_AUDIT permission, enables audit mode — bypasses privacy filters and shows all discussions.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful operation. Returns discussions linked to the document, filtered by privacy settings unless in audit mode.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PolicyDiscussionDTO"}}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"422":{"description":"Unprocessable entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Returns the list of discussions for the target document","tags":["policy-comments"]}}}}
```

## Creates a new discussion linked to the target document

> Creates a new discussion linked to the target document

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-comments"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"NewPolicyDiscussionDTO":{"type":"object","properties":{"name":{"type":"string"},"field":{"type":"string"},"fieldName":{"type":"string"},"parent":{"type":"string"},"privacy":{"type":"string","enum":["public","roles","users"]},"roles":{"type":"array","items":{"type":"string"}},"users":{"type":"array","items":{"type":"string"}},"relationships":{"type":"array","items":{"type":"string"}}}},"PolicyDiscussionDTO":{"type":"object","properties":{"id":{"type":"string"},"uuid":{"type":"string"},"creator":{"type":"string"},"owner":{"type":"string"},"policyId":{"type":"string"},"target":{"type":"string"},"targetId":{"type":"string"},"messageId":{"type":"string"},"parent":{"type":"string"},"hash":{"type":"string"},"name":{"type":"string"},"field":{"type":"string"},"fieldName":{"type":"string"},"relationships":{"type":"array","items":{"type":"string"}},"relationshipIds":{"type":"array","items":{"type":"string"}},"privacy":{"type":"string","enum":["public","roles","users"]},"roles":{"type":"array","items":{"type":"string"}},"users":{"type":"array","items":{"type":"string"}},"system":{"type":"boolean"},"count":{"type":"number","description":"Number of comments in this discussion"},"document":{"nullable":false,"allOf":[{"$ref":"#/components/schemas/VcDTO"}]},"historyIds":{"description":"Array of document IDs that form the history chain for this discussion target (added by API for GET /discussions)","type":"array","items":{"type":"string"}}},"required":["id","document"]},"VcDTO":{"type":"object","properties":{"id":{"type":"string","nullable":true},"@context":{"type":"array","items":{"type":"string"}},"type":{"type":"array","items":{"type":"string"}},"credentialSubject":{"additionalProperties":true,"type":"array","items":{"type":"object"}},"issuer":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"issuanceDate":{"type":"string"},"proof":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/ProofDTO"}]}},"required":["id","@context","type","credentialSubject","issuer","issuanceDate","proof"]},"ProofDTO":{"type":"object","properties":{"type":{"type":"string"},"created":{"type":"string"},"verificationMethod":{"type":"string"},"proofPurpose":{"type":"string"},"jws":{"type":"string"}},"required":["type","created","verificationMethod","proofPurpose","jws"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"UnprocessableEntityErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/policy-comments/{policyId}/{documentId}/discussions":{"post":{"description":"Creates a new discussion linked to the target document","operationId":"PolicyCommentsApi_createDiscussion","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy Id","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document Identifier","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPolicyDiscussionDTO"}}}},"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyDiscussionDTO"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"422":{"description":"Unprocessable entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Creates a new discussion linked to the target document","tags":["policy-comments"]}}}}
```

## Creates a new message in the target discussion.

> Creates a new message in the target discussion

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-comments"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"NewPolicyCommentDTO":{"type":"object","properties":{"anchor":{"type":"string"},"recipients":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"text":{"type":"string"},"files":{"type":"array","items":{"type":"string"}}}},"PolicyCommentDTO":{"type":"object","properties":{"id":{"type":"string"},"uuid":{"type":"string"},"creator":{"type":"string"},"owner":{"type":"string"},"policyId":{"type":"string"},"topicId":{"type":"string"},"policyTopicId":{"type":"string"},"policyInstanceTopicId":{"type":"string"},"target":{"type":"string"},"targetId":{"type":"string"},"discussionMessageId":{"type":"string"},"discussionId":{"type":"string"},"messageId":{"type":"string"},"timestamp":{"type":"string"},"hash":{"type":"string"},"sender":{"type":"string"},"senderRole":{"type":"string"},"senderName":{"type":"string"},"recipients":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"text":{"type":"string"},"document":{"nullable":false,"allOf":[{"$ref":"#/components/schemas/VcDTO"}]},"isOwner":{"type":"boolean","description":"Whether the current user is the sender of this comment (added by API, not stored in DB)"}},"required":["id","document"]},"VcDTO":{"type":"object","properties":{"id":{"type":"string","nullable":true},"@context":{"type":"array","items":{"type":"string"}},"type":{"type":"array","items":{"type":"string"}},"credentialSubject":{"additionalProperties":true,"type":"array","items":{"type":"object"}},"issuer":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"issuanceDate":{"type":"string"},"proof":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/ProofDTO"}]}},"required":["id","@context","type","credentialSubject","issuer","issuanceDate","proof"]},"ProofDTO":{"type":"object","properties":{"type":{"type":"string"},"created":{"type":"string"},"verificationMethod":{"type":"string"},"proofPurpose":{"type":"string"},"jws":{"type":"string"}},"required":["type","created","verificationMethod","proofPurpose","jws"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"UnprocessableEntityErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ServiceUnavailableErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/policy-comments/{policyId}/{documentId}/discussions/{discussionId}/comments":{"post":{"description":"Creates a new message in the target discussion","operationId":"PolicyCommentsApi_createPolicyComment","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy Id","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document Identifier","schema":{"type":"string"}},{"name":"discussionId","required":true,"in":"path","description":"Discussion Identifier","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPolicyCommentDTO"}}}},"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyCommentDTO"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"422":{"description":"Unprocessable entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}},"503":{"description":"Block Unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableErrorDTO"}}}}},"summary":"Creates a new message in the target discussion.","tags":["policy-comments"]}}}}
```

## Returns the list of messages for the target discussion

> Returns the list of messages for the target discussion

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-comments"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"PolicyCommentSearchDTO":{"type":"object","properties":{"search":{"type":"string","description":"Search text — matches against comment text, field name, sender name, or sender role"},"field":{"type":"string","description":"Filter by schema field path (e.g. \"#schema-uuid&version/fieldName\")"},"lt":{"type":"string","description":"Cursor for pagination — return comments with _id less than this value (older comments)"},"gt":{"type":"string","description":"Cursor for pagination — return comments with _id greater than this value (newer comments)"}}},"PolicyCommentDTO":{"type":"object","properties":{"id":{"type":"string"},"uuid":{"type":"string"},"creator":{"type":"string"},"owner":{"type":"string"},"policyId":{"type":"string"},"topicId":{"type":"string"},"policyTopicId":{"type":"string"},"policyInstanceTopicId":{"type":"string"},"target":{"type":"string"},"targetId":{"type":"string"},"discussionMessageId":{"type":"string"},"discussionId":{"type":"string"},"messageId":{"type":"string"},"timestamp":{"type":"string"},"hash":{"type":"string"},"sender":{"type":"string"},"senderRole":{"type":"string"},"senderName":{"type":"string"},"recipients":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"string"}},"text":{"type":"string"},"document":{"nullable":false,"allOf":[{"$ref":"#/components/schemas/VcDTO"}]},"isOwner":{"type":"boolean","description":"Whether the current user is the sender of this comment (added by API, not stored in DB)"}},"required":["id","document"]},"VcDTO":{"type":"object","properties":{"id":{"type":"string","nullable":true},"@context":{"type":"array","items":{"type":"string"}},"type":{"type":"array","items":{"type":"string"}},"credentialSubject":{"additionalProperties":true,"type":"array","items":{"type":"object"}},"issuer":{"oneOf":[{"type":"string"},{"type":"object","additionalProperties":true}]},"issuanceDate":{"type":"string"},"proof":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/ProofDTO"}]}},"required":["id","@context","type","credentialSubject","issuer","issuanceDate","proof"]},"ProofDTO":{"type":"object","properties":{"type":{"type":"string"},"created":{"type":"string"},"verificationMethod":{"type":"string"},"proofPurpose":{"type":"string"},"jws":{"type":"string"}},"required":["type","created","verificationMethod","proofPurpose","jws"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/policy-comments/{policyId}/{documentId}/discussions/{discussionId}/comments/search":{"post":{"description":"Returns the list of messages for the target discussion","operationId":"PolicyCommentsApi_getPolicyComments","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy Id","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document Identifier","schema":{"type":"string"}},{"name":"discussionId","required":true,"in":"path","description":"Discussion Identifier","schema":{"type":"string"}},{"name":"readonly","required":false,"in":"query","description":"When true and user has POLICIES_POLICY_AUDIT permission, enables audit mode — bypasses privacy filters.","schema":{"type":"boolean"}}],"requestBody":{"required":true,"description":"Search params","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyCommentSearchDTO"}}}},"responses":{"200":{"description":"Successful operation.","headers":{"X-Total-Count":{"schema":{"type":"integer"},"description":"Total items in the collection."}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PolicyCommentDTO"}}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Returns the list of messages for the target discussion","tags":["policy-comments"]}}}}
```

## Returns the count of the messages in the target discussion

> Returns the count of the messages in the target discussion

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-comments"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"PolicyCommentCountDTO":{"type":"object","properties":{"fields":{"type":"object","description":"Map of schema field paths to comment counts. Key = field IRI, value = number of comments on that field.","additionalProperties":{"type":"number"}},"count":{"type":"number","description":"Number of comments in this discussion"}},"required":["fields"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"UnprocessableEntityErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ServiceUnavailableErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/policy-comments/{policyId}/{documentId}/comments/count":{"get":{"description":"Returns the count of the messages in the target discussion","operationId":"PolicyCommentsApi_getPolicyCommentsCount","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy Id","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document Identifier","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyCommentCountDTO"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"422":{"description":"Unprocessable entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}},"503":{"description":"Block Unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableErrorDTO"}}}}},"summary":"Returns the count of the messages in the target discussion","tags":["policy-comments"]}}}}
```

## Encrypts and loads the file into IPFS linked to the target discussion

> Encrypts and loads the file into IPFS linked to the target discussion

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-comments"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"UnprocessableEntityErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"error":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/policy-comments/{policyId}/{documentId}/discussions/{discussionId}/comments/file":{"post":{"description":"Encrypts and loads the file into IPFS linked to the target discussion","operationId":"PolicyCommentsApi_postFile","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy Id","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document Identifier","schema":{"type":"string"}},{"name":"discussionId","required":true,"in":"path","description":"Discussion Identifier","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Binary file data to encrypt and upload to IPFS. The file is linked to the target discussion.","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"Successful operation.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"422":{"description":"Unprocessable entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntityErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Encrypts and loads the file into IPFS linked to the target discussion","tags":["policy-comments"]}}}}
```

## Retrieves and decrypts the file associated with the discussion from IPFS

> Retrieves and decrypts the file associated with the discussion from IPFS

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-comments"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/policy-comments/{policyId}/{documentId}/discussions/{discussionId}/comments/file/{cid}":{"get":{"description":"Retrieves and decrypts the file associated with the discussion from IPFS","operationId":"PolicyCommentsApi_getFile","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy Id","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document Identifier","schema":{"type":"string"}},{"name":"discussionId","required":true,"in":"path","description":"Discussion Identifier","schema":{"type":"string"}},{"name":"cid","required":true,"in":"path","description":"IPFS Content Identifier of the uploaded file","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation. Returns the decrypted file as binary stream.","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"404":{"description":"File not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Retrieves and decrypts the file associated with the discussion from IPFS","tags":["policy-comments"]}}}}
```

## Returns the encryption key for the target document discussions.

> Returns the encryption key as a binary file for decrypting discussion content linked to the target document. Optionally filter by specific discussion ID.

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-comments"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UnauthorizedErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]},"ForbiddenErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"},"error":{"type":"string"}},"required":["statusCode","message"]},"InternalServerErrorDTO":{"type":"object","properties":{"statusCode":{"type":"number"},"message":{"type":"string"}},"required":["statusCode","message"]}}},"paths":{"/policy-comments/{policyId}/{documentId}/keys":{"get":{"description":"Returns the encryption key as a binary file for decrypting discussion content linked to the target document. Optionally filter by specific discussion ID.","operationId":"PolicyCommentsApi_getKey","parameters":[{"name":"policyId","required":true,"in":"path","description":"Policy Id","schema":{"type":"string"}},{"name":"documentId","required":true,"in":"path","description":"Document Identifier","schema":{"type":"string"}},{"name":"discussionId","required":false,"in":"query","description":"Discussion Identifier","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedErrorDTO"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenErrorDTO"}}}},"404":{"description":"Key file not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalServerErrorDTO"}}}}},"summary":"Returns the encryption key for the target document discussions.","tags":["policy-comments"]}}}}
```
