> 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/insights/get-insight-by-id.md).

# Get insight by ID

Returns a single insight for a workspace. Used by the remediating agent for context and by the UI for detail views.

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"insights","description":"Insights Service lists insights for a workspace."}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/workspaces/{workspace}/insights/{id}":{"get":{"tags":["insights"],"summary":"Get insight by ID","description":"Returns a single insight for a workspace. Used by the remediating agent for context and by the UI for detail views.","operationId":"insights#get-insight","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":"Insight identifier (recommendation_id).","required":true,"schema":{"type":"string","description":"Insight identifier (recommendation_id).","minLength":1}},{"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/GetInsightResponse"}}}},"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":{"GetInsightResponse":{"type":"object","properties":{"action":{"type":"string","description":"Raw suggested-action string for the insight; empty when not applicable."},"applied_by":{"type":"string","description":"User or system that applied the insight (latest remediating run triggered_by). Empty when not applied via a remediating run."},"applied_on":{"type":"integer","description":"Unix timestamp in milliseconds when the insight was applied (latest remediating run created time). Empty when not applied via a remediating run.","format":"int64"},"details_link":{"type":"string","description":"Deep link to view the insight in the source system."},"id":{"type":"string","description":"Stable per-insight identifier."},"monthly_saving":{"type":"number","description":"Potential monthly saving if the insight is acted on.","format":"double"},"monthly_spend":{"type":"number","description":"Current monthly spend on the resource.","format":"double"},"pipeline_execution_id":{"type":"string","description":"Pipeline execution id for the latest remediation run."},"pipeline_identifier":{"type":"string","description":"Identifier of the pipeline that created the latest remediation run. Empty for runs that predate this column."},"remediation_result_payload":{"description":"Latest remediation result payload (e.g. pr_link, skip reasons, error)."},"remediation_result_type":{"type":"string","description":"Latest remediation result type; empty while in-flight.","enum":["pr_created","explanation"]},"remediation_run_id":{"type":"string","description":"Latest remediation run id for this insight, if any."},"remediation_status":{"type":"string","description":"Latest remediation run status.","enum":["pending","running","succeeded","failed"]},"resource":{"type":"object","description":"Curated, resource-type-specific key/value details.","additionalProperties":true},"resource_type":{"type":"string","description":"Raw resource-type string."},"state":{"type":"string","description":"Insight state: OPEN or APPLIED."},"type":{"type":"string","description":"Insight type.","enum":["cost","drift"]}},"required":["id","type","monthly_saving","monthly_spend","state"]},"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"]}}}}
```
