> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Arvo-AI/aurora/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Incident

> Update incident status and metadata

## PATCH /api/incidents/{incident_id}

Updates specific fields of an incident. Only the fields provided in the request body will be updated.

### Authentication

Requires user authentication via cookies or headers. The `user_id` is extracted from the request.

### Path Parameters

<ParamField path="incident_id" type="string" required>
  UUID of the incident to update
</ParamField>

### Request Body

All fields are optional. Only include the fields you want to update.

<ParamField body="status" type="string">
  Update the incident status. Must be one of: `investigating`, `analyzed`, `merged`, `resolved`

  When set to `resolved`, automatically triggers postmortem generation.
</ParamField>

<ParamField body="auroraStatus" type="string">
  Update Aurora's RCA analysis status. Must be one of: `idle`, `running`, `complete`, `error`
</ParamField>

<ParamField body="summary" type="string">
  Update the incident summary. Maximum length: 10,000 characters
</ParamField>

<ParamField body="activeTab" type="string">
  Update the active tab in the UI. Must be one of: `thoughts`, `chat`
</ParamField>

### Response

Returns a success object with the incident ID.

<ResponseField name="success" type="boolean" required>
  Whether the update was successful
</ResponseField>

<ResponseField name="id" type="string" required>
  UUID of the updated incident
</ResponseField>

### Example Requests

#### Update Status to Resolved

```bash cURL theme={null}
curl -X PATCH "https://api.aurora.example.com/api/incidents/123e4567-e89b-12d3-a456-426614174000" \
  -H "Content-Type: application/json" \
  -H "Cookie: session_token=YOUR_SESSION_TOKEN" \
  -d '{
    "status": "resolved"
  }'
```

#### Update Aurora Status and Summary

```bash cURL theme={null}
curl -X PATCH "https://api.aurora.example.com/api/incidents/123e4567-e89b-12d3-a456-426614174000" \
  -H "Content-Type: application/json" \
  -H "Cookie: session_token=YOUR_SESSION_TOKEN" \
  -d '{
    "auroraStatus": "complete",
    "summary": "Root cause identified: Memory leak in payment-service v2.3.1. Fix deployed in v2.3.2."
  }'
```

#### Update Active Tab

```bash cURL theme={null}
curl -X PATCH "https://api.aurora.example.com/api/incidents/123e4567-e89b-12d3-a456-426614174000" \
  -H "Content-Type: application/json" \
  -H "Cookie: session_token=YOUR_SESSION_TOKEN" \
  -d '{
    "activeTab": "chat"
  }'
```

### Example Response

```json theme={null}
{
  "success": true,
  "id": "123e4567-e89b-12d3-a456-426614174000"
}
```

### Response Codes

<ResponseField name="200" type="Success">
  Successfully updated incident
</ResponseField>

<ResponseField name="400" type="Bad Request">
  * Missing user\_id (authentication failed)
  * Invalid incident ID format (not a valid UUID)
  * Missing request body
  * Invalid field value (e.g., invalid status)
  * Summary too long (max 10,000 characters)
  * No valid fields to update
</ResponseField>

<ResponseField name="404" type="Not Found">
  Incident not found or does not belong to the authenticated user
</ResponseField>

<ResponseField name="500" type="Internal Server Error">
  Failed to update incident
</ResponseField>

### Automatic Behaviors

#### Status Transitions

**When status is set to `analyzed`:**

* The `analyzed_at` timestamp is automatically set to the current time (if not already set)

**When status is set to `resolved` (and previous status was not `resolved`):**

* The `analyzed_at` timestamp is set if not already set
* A background task is automatically triggered to generate a postmortem document
* The postmortem can be retrieved via the postmortems API

#### Updated Timestamp

* The `updated_at` timestamp is automatically updated on every PATCH request

### Validation Rules

<ParamField body="status">
  Must be one of: `investigating`, `analyzed`, `merged`, `resolved`
</ParamField>

<ParamField body="auroraStatus">
  Must be one of: `idle`, `running`, `complete`, `error`
</ParamField>

<ParamField body="activeTab">
  Must be one of: `thoughts`, `chat`
</ParamField>

<ParamField body="summary">
  Maximum length: 10,000 characters
</ParamField>

### Notes

* This is a **PATCH** endpoint, not PUT - only provided fields are updated
* The endpoint uses Row Level Security (RLS) to ensure users can only update their own incidents
* Setting status to `resolved` triggers postmortem generation asynchronously
* You cannot manually set `analyzed_at` - it's automatically managed based on status
* The `updated_at` field is always updated, even if only metadata changes

### Related Endpoints

* [Get Incident](/api/incidents/get) - Retrieve full incident details
* [List Incidents](/api/incidents/list) - List all incidents
