> 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/repository.md).

# Repository

## Returns the list of users present in the policy.

> Returns all users (grouped by DID) who have joined the specified policy, including their roles. The policy owner is always listed as "Administrator". Requires POLICIES\_POLICY\_AUDIT permission.

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-repository"}],"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-repository/{policyId}/users":{"get":{"description":"Returns all users (grouped by DID) who have joined the specified policy, including their roles. The policy owner is always listed as \"Administrator\". Requires POLICIES_POLICY_AUDIT permission.","operationId":"PolicyRepositoryApi_getUsers","parameters":[{"name":"policyId","required":true,"in":"path","description":"Database ID of the policy","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation. Returns array of users 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 users present in the policy.","tags":["policy-repository"]}}}}
```

## Returns the list of published schemas in the target policy.

> Returns only PUBLISHED schemas associated with the policy topic. Returns a subset of fields: uuid, name, version, iri, documentURL, contextURL. Requires POLICIES\_POLICY\_AUDIT permission.

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-repository"}],"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-repository/{policyId}/schemas":{"get":{"description":"Returns only PUBLISHED schemas associated with the policy topic. Returns a subset of fields: uuid, name, version, iri, documentURL, contextURL. Requires POLICIES_POLICY_AUDIT permission.","operationId":"PolicyRepositoryApi_getSchemas","parameters":[{"name":"policyId","required":true,"in":"path","description":"Database ID of the policy","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 published schemas in the target policy.","tags":["policy-repository"]}}}}
```

## Returns the list of documents in the target policy.

> Returns paginated VC or VP documents from the policy. Only documents with a messageId (published to Hedera) are returned. Filter by type (VC or VP), owner DID, or schema IRI. Optionally load comment counts. Requires POLICIES\_POLICY\_AUDIT permission.

```json
{"openapi":"3.0.0","info":{"title":"Guardian","version":"0.0.1"},"tags":[{"name":"policy-repository"}],"servers":[{"url":"/api/v1","description":"version 1.0"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"VcDocumentDTO":{"type":"object","properties":{"id":{"type":"string"},"policyId":{"type":"string"},"hash":{"type":"string"},"signature":{"type":"number"},"status":{"type":"string","enum":["NEW","ISSUE","REVOKE","SUSPEND","RESUME","FAILED"]},"tag":{"type":"string"},"type":{"type":"string"},"createDate":{"type":"string"},"updateDate":{"type":"string"},"owner":{"type":"string"},"hederaStatus":{"type":"string"},"option":{"type":"object","additionalProperties":true},"topicId":{"type":"string"},"messageId":{"type":"string"},"document":{"$ref":"#/components/schemas/VcDTO"}}},"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-repository/{policyId}/documents":{"get":{"description":"Returns paginated VC or VP documents from the policy. Only documents with a messageId (published to Hedera) are returned. Filter by type (VC or VP), owner DID, or schema IRI. Optionally load comment counts. Requires POLICIES_POLICY_AUDIT permission.","operationId":"PolicyRepositoryApi_getDocuments","parameters":[{"name":"policyId","required":true,"in":"path","description":"Database ID of the policy","schema":{"type":"string"}},{"name":"pageIndex","required":false,"in":"query","description":"The number of pages to skip before starting to collect the result set","schema":{"type":"number"}},{"name":"pageSize","required":false,"in":"query","description":"The numbers of items to return","schema":{"type":"number"}},{"name":"type","required":false,"in":"query","description":"Document type to filter by. If not VC or VP, returns empty array.","schema":{"enum":["VC","VP"],"type":"string"}},{"name":"owner","required":false,"in":"query","description":"Filter by document owner DID","schema":{"type":"string"}},{"name":"schema","required":false,"in":"query","description":"Filter by document schema IRI","schema":{"type":"string"}},{"name":"comments","required":false,"in":"query","description":"If true, includes comment count for each VC document","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful operation. Returns documents and total count in X-Total-Count header.","headers":{"X-Total-Count":{"schema":{"type":"integer"},"description":"Total items in the collection."}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VcDocumentDTO"}}}}},"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 in the target policy.","tags":["policy-repository"]}}}}
```
