---
title: "Create insights (batch)"
method: POST
path: "/insights/v1/results"
tags: ["Insights"]
---

# Create insights (batch)

`POST /insights/v1/results`

Creates or updates multiple insights in a single batch request.
Each insight in the batch includes its metadata and resource results inline.
For granular control over insight metadata and resource results independently,
use the single-insight and resource-results endpoints instead.

## Request body

- CreateResultsBody — Request body for creating or updating multiple insights in a batch.
  - `results` InsightRequest[], required — List of insights to create or update.
    - `key` string, required — A unique key for this insight within the source.
    - `title` string, required — The display title of the insight.
    - `shortDescription` string, required — A brief summary of the insight.
    - `detailedDescriptionMdx` string — A detailed description of the insight in MDX format.
    - `cloudProvider` string, required — The cloud provider associated with the resource.
    - `categories` CreateCategory[], required — One or more categories this insight belongs to.
    - `reportUrl` string — URL to an external report related to this insight.
    - `cloudFlowTemplateId` string — ID of a CloudFlow template that can automate the remediation of this insight.
    - `easyWinDescription` string — A description of why this insight is considered an easy win.
    - `resourceResults` ResourceResultRequest[], required — A list of resource-level results for creating or updating an insight.
      - `resourceId` string, required — The cloud resource identifier.
      - `resourceType` string — What the resource actually is, e.g. for an EC2 resource ID, this field would be `instance`. Immutable after creation — updates to this field are silently ignored.
      - `cloudProvider` string, required — The cloud provider associated with the resource.
      - `account` string, required — The cloud account or project ID containing this resource. Immutable after creation — updates to this field are silently ignored.
      - `location` string — Represents the region/zone of the resource in AWS, or equivalent for other providers. Immutable after creation — updates to this field are silently ignored.
      - `externalId` string — the external ID of the resource in the provider's system for the resource
      - `externalUrl` string — the URL to the resource-level issue in the provider's system
      - `metadata` object — contains any additional information for the resource results
      - `resultType` 'security_risk' | 'potential_daily_savings' | 'potential_daily_savings_with_recommendation' | 'potential_daily_savings_with_cluster_agent', required — The discriminator property that determines which fields are populated in the 'result' object.
      - `result` object — The result data for this resource. Which fields are populated depends on the resultType. For security_risk: critical, high, medium, low. For potential_daily_savings: value. For potential_daily_savings_with_recommendation: value, current, recommendation. For potential_daily_savings_with_cluster_agent: value, agentInstalled.
        - `value` number, double — the daily saving amount for this result
        - `critical` integer — number of critical security risks
        - `high` integer — number of high security risks
        - `medium` integer — number of medium security risks
        - `low` integer — number of low security risks
        - `current` string — the current state (i.e. current instance type)
        - `recommendation` string — the recommended state (i.e. recommended instance type)
        - `agentInstalled` boolean — true if the agent is installed

## Response `200`

Successful operation

- ResultsError[]
  - `insightKey` string — The key of the insight that failed.
  - `error` string — The error message.
  - `code` integer — The HTTP status code associated with the error.

## Other responses

- `400` — Bad Request - The server cannot process the request, often due to a malformed request.
- `401` — Unauthorized - Invalid API key.
- `403` — Forbidden - The client is not authorized to perform the request.
- `404` — Not Found - The requested resource does not exist.
- `500` — Internal Server Error - Something went wrong with the DoiT API server.

---

[API](https://skmtc.dev/doit/apis/doit-cloud-intelligence.md) · [All operations](https://skmtc.dev/doit/apis/doit-cloud-intelligence/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/doit/doit-cloud-intelligence/revisions/9416402fc119/schema)
