# Incidents

## POST /incidents/{siteId}/{incidentId}/attachments

> Generate a presigned URL for an attachment to an incident.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}/attachments":{"post":{"tags":["Incidents"],"description":"Generate a presigned URL for an attachment to an incident.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content_type","file_name"],"properties":{"content_type":{"type":"string"},"file_name":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"object_id":{"type":"string"}},"required":["url","object_id"]}}}}}}}}}
```

## PUT /incidents/{siteId}/{incidentId}/attachments

> Add an attachment to an incident.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}/attachments":{"put":{"tags":["Incidents"],"description":"Add an attachment to an incident.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["object_id","content_type","file_name"],"properties":{"object_id":{"type":"string"},"content_type":{"type":"string"},"file_name":{"type":"string"},"description":{"type":"string"},"evidence_type":{"type":"string"},"retention_label":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"raw_url":{"type":"string"},"source_uri":{"type":"string"},"file_type":{"type":"string"},"uploaded":{"type":"boolean"},"object_id":{"type":"string"}},"required":["name","raw_url","source_uri","file_type","uploaded","object_id"]}}}}}}}}}
```

## DELETE /incidents/{siteId}/{incidentId}/attachments

> Delete an attachment from an incident.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}/attachments":{"delete":{"tags":["Incidents"],"description":"Delete an attachment from an incident.","parameters":[{"schema":{"type":"string"},"in":"query","name":"objectId","required":true},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}}}}
```

## GET /incidents/{siteId}/{incidentId}/attachments/download

> Get a download URL for an attachment (audit-logged).

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}/attachments/download":{"get":{"tags":["Incidents"],"description":"Get a download URL for an attachment (audit-logged).","parameters":[{"schema":{"type":"string"},"in":"query","name":"objectId","required":true},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## POST /incidents/{siteId}/{incidentId}/comments

> Create a new comment on an incident.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}/comments":{"post":{"tags":["Incidents"],"description":"Create a new comment on an incident.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"incident":{"type":"string"},"message":{"type":"string"},"author":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"photo_url":{"type":"string"}},"required":["_id","first_name","last_name","photo_url"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","incident","message","author","created_at","updated_at"]}}}}}}}}}
```

## DELETE /incidents/{siteId}/{incidentId}/comments/{commentId}

> Delete a comment on an incident.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}/comments/{commentId}":{"delete":{"tags":["Incidents"],"description":"Delete a comment on an incident.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true},{"schema":{"type":"string"},"in":"path","name":"commentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}}}}}}
```

## POST /incidents

> Create a new incident.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents":{"post":{"tags":["Incidents"],"description":"Create a new incident.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["site","category","source"],"properties":{"site":{"type":"string"},"category":{"type":"string"},"source":{"type":"string"},"people_involved":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"urn":{"type":"number"},"site":{"type":"string"},"category":{"type":"string"},"source":{"type":"string"},"people_involved":{"type":"array","items":{"type":"string"}},"priority":{"type":"string"},"raised_by":{"type":"string"},"status":{"type":"string"},"staff":{"type":"array","items":{"type":"string"}},"attachments":{"type":"array","items":{"type":"string"}},"short_description":{"type":"string"}},"required":["_id","urn","site","category","source","priority","raised_by","status","staff","attachments","short_description"]}}}}}}}}}
```

## POST /incidents/{siteId}/upload

> Create a new from a report from UNN.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/upload":{"post":{"tags":["Incidents"],"description":"Create a new from a report from UNN.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"urn":{"type":"number"},"site":{"type":"string"},"category":{"type":"string"},"source":{"type":"string"},"people_involved":{"type":"array","items":{"type":"string"}},"priority":{"type":"string"},"raised_by":{"type":"string"},"status":{"type":"string"},"staff":{"type":"array","items":{"type":"string"}},"attachments":{"type":"array","items":{"type":"string"}},"short_description":{"type":"string"}},"required":["_id","urn","site","category","source","priority","raised_by","status","staff","attachments","short_description"]}}}}}}}}}
```

## GET /incidents/{siteId}/dashboard

> Get analytics data for the dashboard.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/dashboard":{"get":{"tags":["Incidents"],"description":"Get analytics data for the dashboard.","parameters":[{"schema":{"type":"string"},"in":"query","name":"startDate","required":true},{"schema":{"type":"string"},"in":"query","name":"endDate","required":false},{"schema":{"type":"string"},"in":"query","name":"categoryId","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"incidents":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"created_at":{"type":"string"},"category":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"}}},"priority":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"}}},"raised_by":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"}}},"people_involved":{"type":"array","items":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"}}}},"status":{"type":"string"},"updated_at":{"type":"string"}}}},"totalCount":{"type":"number"}}}}}}}}}}}
```

## GET /incidents/{siteId}/export-csv

> Export incidents matching the current search/filters as a CSV file.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/export-csv":{"get":{"tags":["Incidents"],"description":"Export incidents matching the current search/filters as a CSV file.","parameters":[{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string"},"in":"query","name":"student","required":false},{"schema":{"type":"string"},"in":"query","name":"startDate","required":false},{"schema":{"type":"string"},"in":"query","name":"endDate","required":false},{"schema":{"type":"string"},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string"},"in":"query","name":"assignedTo","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## GET /incidents/{siteId}/handover

> Stream a handover email via SSE, with AI bucketing (last N hours, default 12).

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/handover":{"get":{"tags":["Incidents"],"description":"Stream a handover email via SSE, with AI bucketing (last N hours, default 12).","parameters":[{"schema":{"type":"number"},"in":"query","name":"hours","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## POST /incidents/{siteId}/{incidentId}/inventory

> Prepare inventory for an incident

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}/inventory":{"post":{"tags":["Incidents"],"description":"Prepare inventory for an incident","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## GET /incidents/{siteId}

> Retrieve a list of incidents for a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}":{"get":{"tags":["Incidents"],"description":"Retrieve a list of incidents for a site.","parameters":[{"schema":{"type":"number"},"in":"query","name":"page","required":false},{"schema":{"type":"number"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string"},"in":"query","name":"assignedTo","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"header","name":"X-Socket-Id","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"urn":{"type":"number"},"status":{"type":"string"},"category":{"type":"object","properties":{"name":{"type":"string"},"colour":{"type":"string"},"_id":{"type":"string"}},"required":["name","colour","_id"]},"priority":{"type":"object","properties":{"name":{"type":"string"},"colour":{"type":"string"},"_id":{"type":"string"}},"required":["name","colour","_id"]},"assigned_to":{"type":"object"},"short_description":{"type":"string"},"people_involved":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"location":{"type":"string"},"last_name":{"type":"string"},"student_id":{"type":"string"}},"required":["_id","first_name","last_name"]}},"staff":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"photo_url":{"type":"string"}},"required":["_id","first_name","last_name"]}},"raised_by":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"photo_url":{"type":"string"}},"required":["_id","first_name","last_name","photo_url"]},"source":{"type":"object","properties":{"name":{"type":"string"},"_id":{"type":"string"},"colour":{"type":"string"}},"required":["name","_id","colour"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"retrospective_raised_at":{"type":"string"}},"required":["_id","urn","status","category","priority","short_description","people_involved","staff","raised_by","created_at","updated_at","source","retrospective_raised_at"]}}}}}}}}}}
```

## GET /incidents/{siteId}/{incidentId}

> Retrieve a single incident.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}":{"get":{"tags":["Incidents"],"description":"Retrieve a single incident.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"urn":{"type":"number"},"status":{"type":"string"},"category":{"type":"object","properties":{"name":{"type":"string"},"colour":{"type":"string"},"_id":{"type":"string"}},"required":["name","colour","_id"]},"priority":{"type":"object","properties":{"name":{"type":"string"},"colour":{"type":"string"},"_id":{"type":"string"}},"required":["name","colour","_id"]},"assigned_to":{"type":"array"},"short_description":{"type":"string"},"description":{"type":"string"},"people_involved":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"type":{"type":"string"},"student_id":{"type":"string"},"photo_url":{"type":"string"},"record_name":{"type":"string"},"email":{"type":"string"},"section":{"type":"object","properties":{"name":{"type":"string"},"_id":{"type":"string"}},"required":["name","_id"]},"location":{"type":"string"},"welfare_flag":{"type":"boolean"},"flags":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"}}}},"welfare_state":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"}}}},"required":["_id","first_name","last_name","type","record_name"]}},"staff":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"photo_url":{"type":"string"},"type":{"type":"string"},"record_name":{"type":"string"},"job_title":{"type":"string"}},"required":["_id","first_name","last_name","photo_url","type","record_name"]}},"raised_by":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"photo_url":{"type":"string"}},"required":["_id","first_name","last_name","photo_url"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"retrospective_raised_at":{"type":"string"},"comments":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"incident":{"type":"string"},"message":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"photo_url":{"type":"string"}},"required":["_id","first_name","last_name","photo_url"]}}}},"attachments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"file_type":{"type":"string"},"raw_url":{"type":"string"},"source_uri":{"type":"string"},"uploaded":{"type":"boolean"},"object_id":{"type":"string"}},"required":["name","file_type","raw_url","source_uri","uploaded","object_id"]}},"debug_attachments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"file_type":{"type":"string"},"raw_url":{"type":"string"},"source_uri":{"type":"string"},"uploaded":{"type":"boolean"},"object_id":{"type":"string"}},"required":["name","file_type","raw_url","source_uri","uploaded","object_id"]}},"source":{"type":"object","properties":{"name":{"type":"string"},"_id":{"type":"string"},"colour":{"type":"string"}},"required":["name","_id","colour"]},"custom_fields":{"type":"array","items":{"type":"object","properties":{"form_id":{"type":"string"},"field_id":{"type":"string"},"value":{"type":"string"}}}},"chargeable":{"type":"boolean"},"incident_tracker_sync_status":{"type":"string"},"incident_tracker_reference":{"type":"string"},"report_contains_welfare_flag":{"type":"boolean"},"inventory_status":{"type":"string"},"sla_first_response_at":{"type":"string"},"sla_resolved_at":{"type":"string"}},"required":["_id","urn","status","category","short_description","people_involved","staff","raised_by","created_at","updated_at","comments","attachments","source","chargeable","report_contains_welfare_flag"]}}}}}}}}}
```

## PUT /incidents/{siteId}/{incidentId}

> Update an incident.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}":{"put":{"tags":["Incidents"],"description":"Update an incident.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["attachments","category","people_involved","priority","source","short_description","staff","status"],"properties":{"assigned_to":{"type":"string"},"category":{"type":"string"},"description":{"type":"string"},"people_involved":{"type":"array","items":{"type":"string"}},"priority":{"type":"string"},"source":{"type":"string"},"short_description":{"type":"string"},"staff":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"retrospective_raised_at":{"type":"string"},"custom_fields":{"type":"array","items":{"type":"object","properties":{"form_id":{"type":"string"},"field_id":{"type":"string"},"value":{"type":"string"}}}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}}}}}}}
```

## DELETE /incidents/{siteId}/{incidentId}

> Delete a single incident.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}":{"delete":{"tags":["Incidents"],"description":"Delete a single incident.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## GET /incidents/{siteId}/{incidentId}/export

> Export a single incident as a PDF.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}/export":{"get":{"tags":["Incidents"],"description":"Export a single incident as a PDF.","parameters":[{"schema":{"type":"boolean"},"in":"query","name":"withAttachments","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## GET /incidents/{siteId}/search

> Retrieve a list of incidents for a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/search":{"get":{"tags":["Incidents"],"description":"Retrieve a list of incidents for a site.","parameters":[{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string"},"in":"query","name":"student","required":false},{"schema":{"type":"number"},"in":"query","name":"page","required":false},{"schema":{"type":"number"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"startDate","required":false},{"schema":{"type":"string"},"in":"query","name":"endDate","required":false},{"schema":{"type":"string"},"in":"query","name":"sortBy","required":false},{"schema":{"type":"string"},"in":"query","name":"assignedTo","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"header","name":"x-socket-id","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"urn":{"type":"number"},"status":{"type":"string"},"category":{"type":"object","properties":{"name":{"type":"string"},"colour":{"type":"string"},"_id":{"type":"string"}},"required":["name","colour","_id"]},"priority":{"type":"object","properties":{"name":{"type":"string"},"colour":{"type":"string"},"_id":{"type":"string"}},"required":["name","colour","_id"]},"source":{"type":"object","properties":{"name":{"type":"string"},"_id":{"type":"string"},"colour":{"type":"string"}},"required":["name","_id","colour"]},"assigned_to":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}},"required":["_id","first_name","last_name"]},"short_description":{"type":"string"},"people_involved":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"location":{"type":"string"},"last_name":{"type":"string"},"student_id":{"type":"string"}},"required":["_id","first_name","last_name"]}},"staff":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"photo_url":{"type":"string"}},"required":["_id","first_name","last_name"]}},"raised_by":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"photo_url":{"type":"string"}},"required":["_id","first_name","last_name","photo_url"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"retrospective_raised_at":{"type":"string"},"attachments_length":{"type":"number"},"user_comments_count":{"type":"number"},"sla_first_response_at":{"type":"string"},"sla_resolved_at":{"type":"string"}},"required":["_id","urn","status","category","priority","source","short_description","people_involved","staff","raised_by","created_at","updated_at","retrospective_raised_at","attachments_length","user_comments_count"]}}}}}}}}}}
```

## GET /incidents/{siteId}/stale

> Retrieve stale incidents for a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/stale":{"get":{"tags":["Incidents"],"description":"Retrieve stale incidents for a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"header","name":"x-socket-id","required":false}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"urn":{"type":"number"},"status":{"type":"string"},"category":{"type":"object","properties":{"name":{"type":"string"},"colour":{"type":"string"},"_id":{"type":"string"}},"required":["name","colour","_id"]},"priority":{"type":"object","properties":{"name":{"type":"string"},"colour":{"type":"string"},"_id":{"type":"string"}},"required":["name","colour","_id"]},"source":{"type":"object","properties":{"name":{"type":"string"},"_id":{"type":"string"},"colour":{"type":"string"}},"required":["name","_id","colour"]},"assigned_to":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}},"required":["_id","first_name","last_name"]},"short_description":{"type":"string"},"people_involved":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"location":{"type":"string"},"last_name":{"type":"string"},"student_id":{"type":"string"}},"required":["_id","first_name","last_name"]}},"staff":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"photo_url":{"type":"string"}},"required":["_id","first_name","last_name"]}},"raised_by":{"type":"object","properties":{"_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"photo_url":{"type":"string"}},"required":["_id","first_name","last_name","photo_url"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"retrospective_raised_at":{"type":"string"},"attachments_length":{"type":"number"},"user_comments_count":{"type":"number"},"sla_first_response_at":{"type":"string"},"sla_resolved_at":{"type":"string"}},"required":["_id","urn","status","category","priority","source","short_description","people_involved","staff","raised_by","created_at","updated_at","retrospective_raised_at","attachments_length","user_comments_count"]}}}}}}}}}}
```

## GET /incidents/reindex

> Reindex all incidents in Typesense (admin only).

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/reindex":{"get":{"tags":["Incidents"],"description":"Reindex all incidents in Typesense (admin only).","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}}}}}}}}}
```

## POST /incidents/{siteId}/{incidentId}/sync

> Sync an incident to the incident tracker

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/incidents/{siteId}/{incidentId}/sync":{"post":{"tags":["Incidents"],"description":"Sync an incident to the incident tracker","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"incidentId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```
