> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/platform-apis/governance/examples.md).

# Examples

Example rego policies and corresponding input

## GET /api/v1/examples

> list examples

```json
{"openapi":"3.0.3","info":{"title":"Governance Policy Management API","version":"1.2.0"},"tags":[{"name":"examples","description":"Example rego policies and corresponding input"}],"servers":[{"url":"https://app.harness.io/gateway/pm/"}],"security":[{"jwt_header_Authorization":["core_governancePolicy_view"]},{"api_key_header_x-api-key":[]}],"components":{"securitySchemes":{"jwt_header_Authorization":{"type":"http","scheme":"bearer"},"api_key_header_x-api-key":{"type":"apiKey","description":"Harness PAT","name":"x-api-key","in":"header"}},"schemas":{"PolicyExample":{"type":"object","properties":{"desc":{"type":"string","description":"Longer description of the example"},"input":{"type":"string","description":"Example input to illustrate the rego policy"},"name":{"type":"string","description":"Example name"},"rego":{"type":"string","description":"Example rego policy"},"type":{"type":"string","description":"The type of entity illustrated in this example"},"variables":{"type":"array","items":{"$ref":"#/components/schemas/Variable"},"description":"The list of substitutable variables in the policy example"}},"description":"Example policies and input","required":["name","desc","type","rego","input"]},"Variable":{"type":"object","properties":{"default":{"type":"array","items":{"type":"string"},"description":"The values that are selected by default"},"desc":{"type":"string","description":"Longer description of the variable to substitute"},"id":{"type":"string","description":"The id of the variable to substitute in the rego"},"name":{"type":"string","description":"The human readable name of the variable to substitute in the rego"},"type":{"type":"string","description":"The variable type","enum":["text","textMultiple","selectOne","selectMultiple"]},"values":{"type":"array","items":{"type":"string"},"description":"Pre populated sample values to substitute the variable with"}}},"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?"},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem."},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem."},"name":{"type":"string","description":"Name is the name of this class of errors."},"temporary":{"type":"boolean","description":"Is the error temporary?"},"timeout":{"type":"boolean","description":"Is the error a timeout?"}},"required":["name","id","message","temporary","timeout","fault"]}}},"paths":{"/api/v1/examples":{"get":{"tags":["examples"],"description":"list examples","operationId":"examples#list","parameters":[{"name":"accountIdentifier","in":"query","description":"Harness account ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness account ID","default":""}},{"name":"orgIdentifier","in":"query","description":"Harness organization ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness organization ID","default":""}},{"name":"projectIdentifier","in":"query","description":"Harness project ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness project ID","default":""}},{"name":"x-api-key","in":"header","description":"Harness PAT key used to perform authorization","allowEmptyValue":true,"schema":{"type":"string","description":"Harness PAT key used to perform authorization"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PolicyExample"}}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFound: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServer: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGateway: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
