> 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/infrastructure-as-code-management/iacm-api-reference/remediation/create-remediation-run.md).

# 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"]}}}}
```
