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

# Remediation

Remediation service handles the API for AI-powered drift remediation runs

## Get remediation config

> Check whether AI remediation is enabled for a workspace

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"remediation","description":"Remediation service handles the API for AI-powered drift remediation runs"}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remediation/config":{"get":{"tags":["remediation"],"summary":"Get remediation config","description":"Check whether AI remediation is enabled for a workspace","operationId":"remediation#get-remediation-config","parameters":[{"name":"org","in":"path","description":"Org is the organisation identifier.","required":true,"schema":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128}},{"name":"project","in":"path","description":"Project is the project identifier.","required":true,"schema":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128}},{"name":"workspace","in":"path","description":"Workspace identifier","required":true,"schema":{"type":"string","description":"Workspace identifier","minLength":1,"maxLength":128}},{"name":"Harness-Account","in":"header","description":"Account is the internal customer account ID.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRemediationConfigResponse"}}}},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"GetRemediationConfigResponse":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether remediation is enabled for this workspace"},"source":{"type":"string","description":"Origin of the configuration","enum":["project","disabled","none"]}},"required":["enabled","source"]},"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"]}}}}
```

## Enable remediation

> Enable AI remediation for a workspace

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"remediation","description":"Remediation service handles the API for AI-powered drift remediation runs"}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remediation/config":{"put":{"tags":["remediation"],"summary":"Enable remediation","description":"Enable AI remediation for a workspace","operationId":"remediation#enable-remediation","parameters":[{"name":"org","in":"path","description":"Org is the organisation identifier.","required":true,"schema":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128}},{"name":"project","in":"path","description":"Project is the project identifier.","required":true,"schema":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128}},{"name":"workspace","in":"path","description":"Workspace identifier","required":true,"schema":{"type":"string","description":"Workspace identifier","minLength":1,"maxLength":128}},{"name":"Harness-Account","in":"header","description":"Account is the internal customer account ID.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"OK response."},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"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"]}}}}
```

## Disable remediation

> Disable AI remediation for a workspace

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"remediation","description":"Remediation service handles the API for AI-powered drift remediation runs"}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remediation/config":{"delete":{"tags":["remediation"],"summary":"Disable remediation","description":"Disable AI remediation for a workspace","operationId":"remediation#disable-remediation","parameters":[{"name":"org","in":"path","description":"Org is the organisation identifier.","required":true,"schema":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128}},{"name":"project","in":"path","description":"Project is the project identifier.","required":true,"schema":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128}},{"name":"workspace","in":"path","description":"Workspace identifier","required":true,"schema":{"type":"string","description":"Workspace identifier","minLength":1,"maxLength":128}},{"name":"Harness-Account","in":"header","description":"Account is the internal customer account ID.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"OK response."},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"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"]}}}}
```

## Get drift plan

> Download the plan file associated with the workspace's current drift state. Validates the workspace is drifted and returns the plan binary from the drift-detection activity.

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"remediation","description":"Remediation service handles the API for AI-powered drift remediation runs"}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remediation/drift-plan":{"get":{"tags":["remediation"],"summary":"Get drift plan","description":"Download the plan file associated with the workspace's current drift state. Validates the workspace is drifted and returns the plan binary from the drift-detection activity.","operationId":"remediation#get-drift-plan","parameters":[{"name":"org","in":"path","description":"Org is the organisation identifier.","required":true,"schema":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128}},{"name":"project","in":"path","description":"Project is the project identifier.","required":true,"schema":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128}},{"name":"workspace","in":"path","description":"Workspace identifier","required":true,"schema":{"type":"string","description":"Workspace identifier","minLength":1,"maxLength":128}},{"name":"Harness-Account","in":"header","description":"Account is the internal customer account ID.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"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"]}}}}
```

## List remediation runs

> List remediation runs for a workspace

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"remediation","description":"Remediation service handles the API for AI-powered drift remediation runs"}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remediation/runs":{"get":{"tags":["remediation"],"summary":"List remediation runs","description":"List remediation runs for a workspace","operationId":"remediation#list-remediation-runs","parameters":[{"name":"limit","in":"query","description":"Limit is the number of records to return for a page.","allowEmptyValue":true,"schema":{"type":"integer","description":"Limit is the number of records to return for a page.","default":30,"format":"int64","minimum":1,"maximum":1000}},{"name":"page","in":"query","description":"Page is the page number to return relative to the page 'limit'.","allowEmptyValue":true,"schema":{"type":"integer","description":"Page is the page number to return relative to the page 'limit'.","default":1,"format":"int64","minimum":1}},{"name":"org","in":"path","description":"Org is the organisation identifier.","required":true,"schema":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128}},{"name":"project","in":"path","description":"Project is the project identifier.","required":true,"schema":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128}},{"name":"workspace","in":"path","description":"Workspace identifier","required":true,"schema":{"type":"string","description":"Workspace identifier","minLength":1,"maxLength":128}},{"name":"Harness-Account","in":"header","description":"Account is the internal customer account ID.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"OK response.","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemediationRunResourceCollection"}}}},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"RemediationRunResourceCollection":{"type":"array","items":{"$ref":"#/components/schemas/HarnessIacmRemediationRun"}},"HarnessIacmRemediationRun":{"type":"object","properties":{"account":{"type":"string"},"created":{"type":"integer","description":"Created timestamp in milliseconds","format":"int64"},"id":{"type":"string","description":"Unique identifier"},"input_payload":{"description":"Input context"},"insight_id":{"type":"string","description":"Insight (recommendation) id linked to this run, if any."},"org":{"type":"string"},"pipeline_execution_id":{"type":"string"},"pipeline_identifier":{"type":"string","description":"Identifier of the pipeline that created this run."},"project":{"type":"string"},"recommendation_source":{"type":"string","description":"Recommendation source persisted for the insight link (derived server-side from remediation_type)."},"remediation_type":{"type":"string","enum":["drift","ccm","sto","custom"]},"result_payload":{"description":"Result data"},"result_type":{"type":"string","enum":["pr_created","explanation"]},"status":{"type":"string","description":"Current status","enum":["pending","running","succeeded","failed"]},"triggered_by":{"type":"string"},"updated":{"type":"integer","description":"Updated timestamp in milliseconds","format":"int64"},"workspace":{"type":"string"}},"description":"RemediationRun represents a single remediation execution","required":["id","account","org","project","workspace","status","remediation_type","triggered_by","created","updated"]},"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"]}}}}
```

## Create remediation run

> Create a new remediation run (called by the remediation pipeline plugin)

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"remediation","description":"Remediation service handles the API for AI-powered drift remediation runs"}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remediation/runs":{"post":{"tags":["remediation"],"summary":"Create remediation run","description":"Create a new remediation run (called by the remediation pipeline plugin)","operationId":"remediation#create-remediation-run","parameters":[{"name":"org","in":"path","description":"Org is the organisation identifier.","required":true,"schema":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128}},{"name":"project","in":"path","description":"Project is the project identifier.","required":true,"schema":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128}},{"name":"workspace","in":"path","description":"Workspace identifier","required":true,"schema":{"type":"string","description":"Workspace identifier","minLength":1,"maxLength":128}},{"name":"Harness-Account","in":"header","description":"Account is the internal customer account ID.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRemediationRunRequest"}}}},"responses":{"201":{"description":"Created response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRemediationRunResponse"}}}},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"CreateRemediationRunRequest":{"type":"object","properties":{"input_payload":{"description":"Input context for the remediation agent"},"insight_id":{"type":"string","description":"Insight (recommendation) id being remediated; empty for legacy callers."},"pipeline_execution_id":{"type":"string","description":"Pipeline execution identifier"},"pipeline_identifier":{"type":"string","description":"Identifier of the pipeline that created this run (from the caller's HARNESS_PIPELINE_ID). Empty for legacy callers."},"remediation_type":{"type":"string","description":"Type of remediation","enum":["drift","ccm","sto","custom"]},"triggered_by":{"type":"string","description":"User or system that triggered the run"}},"required":["remediation_type","triggered_by"]},"CreateRemediationRunResponse":{"type":"object","properties":{"account":{"type":"string"},"created":{"type":"integer","description":"Created timestamp in milliseconds","format":"int64"},"id":{"type":"string","description":"Unique identifier"},"input_payload":{"description":"Input context"},"insight_id":{"type":"string","description":"Insight (recommendation) id linked to this run, if any."},"org":{"type":"string"},"pipeline_execution_id":{"type":"string"},"pipeline_identifier":{"type":"string","description":"Identifier of the pipeline that created this run."},"project":{"type":"string"},"recommendation_source":{"type":"string","description":"Recommendation source persisted for the insight link (derived server-side from remediation_type)."},"remediation_type":{"type":"string","enum":["drift","ccm","sto","custom"]},"result_payload":{"description":"Result data"},"result_type":{"type":"string","enum":["pr_created","explanation"]},"status":{"type":"string","description":"Current status","enum":["pending","running","succeeded","failed"]},"triggered_by":{"type":"string"},"updated":{"type":"integer","description":"Updated timestamp in milliseconds","format":"int64"},"workspace":{"type":"string"}},"required":["id","account","org","project","workspace","status","remediation_type","triggered_by","created","updated"]},"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"]}}}}
```

## Get remediation run

> Get a single remediation run by ID

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"remediation","description":"Remediation service handles the API for AI-powered drift remediation runs"}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remediation/runs/{id}":{"get":{"tags":["remediation"],"summary":"Get remediation run","description":"Get a single remediation run by ID","operationId":"remediation#get-remediation-run","parameters":[{"name":"org","in":"path","description":"Org is the organisation identifier.","required":true,"schema":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128}},{"name":"project","in":"path","description":"Project is the project identifier.","required":true,"schema":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128}},{"name":"workspace","in":"path","description":"Workspace identifier","required":true,"schema":{"type":"string","description":"Workspace identifier","minLength":1,"maxLength":128}},{"name":"id","in":"path","description":"Remediation run identifier","required":true,"schema":{"type":"string","description":"Remediation run identifier"}},{"name":"Harness-Account","in":"header","description":"Account is the internal customer account ID.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRemediationRunResponse"}}}},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"GetRemediationRunResponse":{"type":"object","properties":{"account":{"type":"string"},"created":{"type":"integer","description":"Created timestamp in milliseconds","format":"int64"},"id":{"type":"string","description":"Unique identifier"},"input_payload":{"description":"Input context"},"insight_id":{"type":"string","description":"Insight (recommendation) id linked to this run, if any."},"org":{"type":"string"},"pipeline_execution_id":{"type":"string"},"pipeline_identifier":{"type":"string","description":"Identifier of the pipeline that created this run."},"project":{"type":"string"},"recommendation_source":{"type":"string","description":"Recommendation source persisted for the insight link (derived server-side from remediation_type)."},"remediation_type":{"type":"string","enum":["drift","ccm","sto","custom"]},"result_payload":{"description":"Result data"},"result_type":{"type":"string","enum":["pr_created","explanation"]},"status":{"type":"string","description":"Current status","enum":["pending","running","succeeded","failed"]},"triggered_by":{"type":"string"},"updated":{"type":"integer","description":"Updated timestamp in milliseconds","format":"int64"},"workspace":{"type":"string"}},"required":["id","account","org","project","workspace","status","remediation_type","triggered_by","created","updated"]},"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"]}}}}
```

## Update remediation run

> Update a remediation run status and results (called by the remediation pipeline plugin)

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"remediation","description":"Remediation service handles the API for AI-powered drift remediation runs"}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remediation/runs/{id}":{"put":{"tags":["remediation"],"summary":"Update remediation run","description":"Update a remediation run status and results (called by the remediation pipeline plugin)","operationId":"remediation#update-remediation-run","parameters":[{"name":"org","in":"path","description":"Org is the organisation identifier.","required":true,"schema":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128}},{"name":"project","in":"path","description":"Project is the project identifier.","required":true,"schema":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128}},{"name":"workspace","in":"path","description":"Workspace identifier","required":true,"schema":{"type":"string","description":"Workspace identifier","minLength":1,"maxLength":128}},{"name":"id","in":"path","description":"Remediation run identifier","required":true,"schema":{"type":"string","description":"Remediation run identifier"}},{"name":"Harness-Account","in":"header","description":"Account is the internal customer account ID.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRemediationRunRequest"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRemediationRunResponse"}}}},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"UpdateRemediationRunRequest":{"type":"object","properties":{"pipeline_execution_id":{"type":"string","description":"Pipeline execution identifier"},"result_payload":{"description":"Result data from the remediation agent"},"result_type":{"type":"string","description":"Type of result","enum":["pr_created","explanation"]},"status":{"type":"string","description":"New status","enum":["running","succeeded","failed"]}},"required":["status"]},"UpdateRemediationRunResponse":{"type":"object","properties":{"account":{"type":"string"},"created":{"type":"integer","description":"Created timestamp in milliseconds","format":"int64"},"id":{"type":"string","description":"Unique identifier"},"input_payload":{"description":"Input context"},"insight_id":{"type":"string","description":"Insight (recommendation) id linked to this run, if any."},"org":{"type":"string"},"pipeline_execution_id":{"type":"string"},"pipeline_identifier":{"type":"string","description":"Identifier of the pipeline that created this run."},"project":{"type":"string"},"recommendation_source":{"type":"string","description":"Recommendation source persisted for the insight link (derived server-side from remediation_type)."},"remediation_type":{"type":"string","enum":["drift","ccm","sto","custom"]},"result_payload":{"description":"Result data"},"result_type":{"type":"string","enum":["pr_created","explanation"]},"status":{"type":"string","description":"Current status","enum":["pending","running","succeeded","failed"]},"triggered_by":{"type":"string"},"updated":{"type":"integer","description":"Updated timestamp in milliseconds","format":"int64"},"workspace":{"type":"string"}},"required":["id","account","org","project","workspace","status","remediation_type","triggered_by","created","updated"]},"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"]}}}}
```
