> 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/audit-trails/audit-yaml.md).

# Audit Yaml

This contains APIs related to Audit Yaml as defined in Harness

## GET /auditYaml

> Gets the YamlDiff of the Audit.

```json
{"openapi":"3.0.1","info":{"title":"Audit Service API Reference","version":"3.0"},"tags":[{"name":"AuditYaml","description":"This contains APIs related to Audit Yaml as defined in Harness"}],"servers":[{"url":"https://platform-service-6ccff6c88d-fn7wc"}],"paths":{"/auditYaml":{"get":{"tags":["AuditYaml"],"summary":"Gets the YamlDiff of the Audit.","operationId":"getYamlDiff","parameters":[{"name":"accountIdentifier","in":"query","description":"Account Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"auditId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"Returns the old Yaml and new Yaml.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseDTOYamlDiffRecord"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/ResponseDTOYamlDiffRecord"}}}}}}}},"components":{"schemas":{"ResponseDTOYamlDiffRecord":{"type":"object","properties":{"status":{"type":"string","enum":["SUCCESS","FAILURE","ERROR"]},"data":{"$ref":"#/components/schemas/YamlDiffRecord"},"metaData":{"type":"object"},"correlationId":{"type":"string"}}},"YamlDiffRecord":{"type":"object","properties":{"oldYaml":{"type":"string","description":"Previous YAML version"},"newYaml":{"type":"string","description":"Current YAML version"}},"description":"This has the YAML Difference of the record."}}}}
```

## Get YAML Diffs for Audit Events

> Computes field-level YAML diffs for the given audit event IDs in RFC 6902 JSON Patch format. Maximum 20 event IDs per request. Only whitelisted resource types return a diff entry; non-whitelisted events are silently omitted from the response.

```json
{"openapi":"3.0.1","info":{"title":"Audit Service API Reference","version":"3.0"},"tags":[{"name":"AuditYaml","description":"This contains APIs related to Audit Yaml as defined in Harness"}],"servers":[{"url":"https://platform-service-6ccff6c88d-fn7wc"}],"paths":{"/auditYaml/diffs":{"post":{"tags":["AuditYaml"],"summary":"Get YAML Diffs for Audit Events","description":"Computes field-level YAML diffs for the given audit event IDs in RFC 6902 JSON Patch format. Maximum 20 event IDs per request. Only whitelisted resource types return a diff entry; non-whitelisted events are silently omitted from the response.","operationId":"getAuditYamlDiffs","parameters":[{"name":"accountIdentifier","in":"query","description":"Account Identifier for the Entity.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"List of audit event IDs to compute YAML diffs for (max 20).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/YamlDiffRequest"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/YamlDiffRequest"}}},"required":true},"responses":{"default":{"description":"Returns a list of per-event diff results. Events with no yamlDiff record or unsupported resource types are absent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseDTOYamlDiffResponse"}},"application/yaml":{"schema":{"$ref":"#/components/schemas/ResponseDTOYamlDiffResponse"}}}}}}}},"components":{"schemas":{"YamlDiffRequest":{"required":["auditEventIds"],"type":"object","properties":{"auditEventIds":{"maxItems":20,"minItems":0,"type":"array","description":"List of audit event IDs to compute YAML diffs for. Maximum 20 per request.","items":{"type":"string","description":"List of audit event IDs to compute YAML diffs for. Maximum 20 per request."}}},"description":"Request body for computing YAML diffs for audit events."},"ResponseDTOYamlDiffResponse":{"type":"object","properties":{"status":{"type":"string","enum":["SUCCESS","FAILURE","ERROR"]},"data":{"$ref":"#/components/schemas/YamlDiffResponse"},"metaData":{"type":"object"},"correlationId":{"type":"string"}}},"YamlDiffResponse":{"type":"object","properties":{"diffs":{"type":"array","description":"Per-event diff results. Absent entries were silently omitted (non-whitelisted type or no yamlDiff record).","items":{"$ref":"#/components/schemas/AuditEventYamlDiff"}},"batchTruncated":{"type":"boolean","description":"True when the total response size reached the 1 MB batch cap before all requested event IDs were processed. Remaining event IDs were omitted. Re-request in smaller batches to retrieve them."}},"description":"Batch response containing per-event YAML diffs and a batch-level truncation indicator."},"AuditEventYamlDiff":{"type":"object","properties":{"auditEventId":{"type":"string","description":"The audit event ID this diff corresponds to."},"diff":{"$ref":"#/components/schemas/JsonNode"},"error":{"type":"string","description":"Error code if the diff could not be computed for this event."}},"description":"Computed YAML diff for a single audit event in RFC 6902 JSON Patch format."},"JsonNode":{"type":"object","description":"RFC 6902 JSON Patch array representing field-level changes. Each entry has op (add/remove/replace), path, value, and fromValue (for replace/remove)."}}}}
```
