# Regenerate a deal's AI insights

Reads the deal again — its cells plus whatever the document analysis found — and REPLACES the stored summary and bullets. Spends the workspace's OpenAI budget, so it is an act rather than something a page load does: reach for it when the deal has changed materially, not to refresh a view. Refuses with a sentence when the workspace has connected no OpenAI key, and answers 409 when the deal carries too little to say anything about.

Access class: `def:read`.

## Endpoint

`POST /v1/definitions/{key}/rows/{rowId}/ai/insights`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| rowId | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {},
  "params": {
    ":key": "string",
    ":rowId": ""
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "createdAt": "string",
    "dealRowId": "",
    "generatedAt": "string",
    "generatedBy": 1,
    "id": 1,
    "insights": [
      "string"
    ],
    "model": "string",
    "summary": "string",
    "updatedAt": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
