> 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/core-platform/drift-detection.md).

# Drift Detection

APIs to track drift between the last deployed manifest and the live cluster state

## GET /drift-detection/{entityId}

> Get the captured deployment snapshot and latest drift check result for a deployed target

```json
{"openapi":"3.0.1","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"3.0"},"tags":[{"name":"Drift Detection","description":"APIs to track drift between the last deployed manifest and the live cluster state"}],"servers":[{"url":"https://ng-manager-7b6bb5bdbc-5jxjn/gateway/ng/api"}],"paths":{"/drift-detection/{entityId}":{"get":{"tags":["Drift Detection"],"summary":"Get the captured deployment snapshot and latest drift check result for a deployed target","operationId":"getDriftDetectionDetail","parameters":[{"name":"entityId","in":"path","description":"Identifier of the deployed target (e.g. infrastructure key)","required":true,"schema":{"type":"string"}},{"name":"accountIdentifier","in":"query","description":"Account Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"orgIdentifier","in":"query","description":"Organization Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"projectIdentifier","in":"query","description":"Project Identifier for the Entity.","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"Returns the drift detection detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseDTODriftDetectionDetail"}}}}}}}},"components":{"schemas":{"ResponseDTODriftDetectionDetail":{"type":"object","properties":{"status":{"type":"string","enum":["SUCCESS","FAILURE","ERROR"]},"data":{"$ref":"#/components/schemas/DriftDetectionDetail"},"metaData":{"type":"object"},"correlationId":{"type":"string"}}},"DriftDetectionDetail":{"type":"object","properties":{"entityId":{"type":"string"},"type":{"type":"string","enum":["K8S_MANIFEST_DIFF"]},"serviceRef":{"type":"string"},"envRef":{"type":"string"},"infraIdentifier":{"type":"string"},"connectorRef":{"type":"string"},"capturedPayload":{"$ref":"#/components/schemas/DriftDetectionPayload"},"lastDeploymentAt":{"type":"integer","format":"int64"},"status":{"type":"string","enum":["NO_DRIFT","DRIFTED","ERROR"]},"errorMessage":{"type":"string"},"lastDriftCheckAt":{"type":"integer","format":"int64"},"infraNamespace":{"type":"string"},"resourceNamespaces":{"type":"array","items":{"type":"string"}},"driftPayload":{"$ref":"#/components/schemas/DriftDetectionResultPayload"}},"description":"Full detail of a deployed target tracked for drift detection"},"DriftDetectionPayload":{"required":["@type"],"type":"object","properties":{"infraNamespace":{"type":"string"},"type":{"type":"string","enum":["K8S_MANIFEST_DIFF"]},"@type":{"type":"string"}},"discriminator":{"propertyName":"@type"}},"DriftDetectionResultPayload":{"required":["@type"],"type":"object","properties":{"@type":{"type":"string"}},"discriminator":{"propertyName":"@type"}}}}}
```

## GET /drift-detection

> List deployed targets (service/env/infra) tracked for drift detection in a project

```json
{"openapi":"3.0.1","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"3.0"},"tags":[{"name":"Drift Detection","description":"APIs to track drift between the last deployed manifest and the live cluster state"}],"servers":[{"url":"https://ng-manager-7b6bb5bdbc-5jxjn/gateway/ng/api"}],"paths":{"/drift-detection":{"get":{"tags":["Drift Detection"],"summary":"List deployed targets (service/env/infra) tracked for drift detection in a project","operationId":"listDriftDetectionTargets","parameters":[{"name":"accountIdentifier","in":"query","description":"Account Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"orgIdentifier","in":"query","description":"Organization Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"projectIdentifier","in":"query","description":"Project Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page Index of the results to fetch.Default Value: 0","schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Results per page","schema":{"type":"integer","format":"int32","default":25}},{"name":"sort","in":"query","description":"Sort criteria for the elements.","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"default":{"description":"Returns the paginated list of drift detection targets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseDTOPageResponseDriftDetectionSummary"}}}}}}}},"components":{"schemas":{"ResponseDTOPageResponseDriftDetectionSummary":{"type":"object","properties":{"status":{"type":"string","enum":["SUCCESS","FAILURE","ERROR"]},"data":{"$ref":"#/components/schemas/PageResponseDriftDetectionSummary"},"metaData":{"type":"object"},"correlationId":{"type":"string"}}},"PageResponseDriftDetectionSummary":{"type":"object","properties":{"totalPages":{"type":"integer","format":"int64"},"totalItems":{"type":"integer","format":"int64"},"pageItemCount":{"type":"integer","format":"int64"},"pageSize":{"type":"integer","format":"int64"},"content":{"type":"array","items":{"$ref":"#/components/schemas/DriftDetectionSummary"}},"pageIndex":{"type":"integer","format":"int64"},"empty":{"type":"boolean"},"pageToken":{"type":"string"}}},"DriftDetectionSummary":{"type":"object","properties":{"entityId":{"type":"string"},"type":{"type":"string","enum":["K8S_MANIFEST_DIFF"]},"serviceRef":{"type":"string"},"envRef":{"type":"string"},"infraIdentifier":{"type":"string"},"connectorRef":{"type":"string"},"status":{"type":"string","enum":["NO_DRIFT","DRIFTED","ERROR"]},"errorMessage":{"type":"string"},"lastDriftCheckAt":{"type":"integer","format":"int64"},"infraNamespace":{"type":"string"},"resourceNamespaces":{"type":"array","items":{"type":"string"}},"lastDeploymentAt":{"type":"integer","format":"int64"}},"description":"Summary of a deployed target tracked for drift detection"}}}}
```
