# Sites

## GET /sites/{siteId}/block-bookings

> List block bookings for a site. Each row includes member counts and a status summary so the list view doesn't need a follow-up query.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/block-bookings":{"get":{"tags":["Sites"],"description":"List block bookings for a site. Each row includes member counts and a status summary so the list view doesn't need a follow-up query.","parameters":[{"schema":{"type":"string"},"in":"query","name":"q","required":false},{"schema":{"type":"boolean"},"in":"query","name":"archived","required":false},{"schema":{"type":"number"},"in":"query","name":"limit","required":false},{"schema":{"type":"number"},"in":"query","name":"skip","required":false},{"schema":{"type":"string","enum":["created_at","name","contract_start_min"]},"in":"query","name":"sort","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## GET /sites/{siteId}/cancellation-codes

> List cancellation codes 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":{"/sites/{siteId}/cancellation-codes":{"get":{"tags":["Sites"],"description":"List cancellation codes for a site.","parameters":[{"schema":{"type":"boolean","default":false},"in":"query","name":"include_inactive","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","inactive"]}}}}}}}}}}
```

## POST /sites/{siteId}/cancellation-codes

> Create a new cancellation code 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":{"/sites/{siteId}/cancellation-codes":{"post":{"tags":["Sites"],"description":"Create a new cancellation code for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","description"],"properties":{"code":{"type":"string","maxLength":16},"description":{"type":"string"},"sequence":{"type":"number","default":0},"inactive":{"type":"boolean","default":false}}}}}},"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"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","inactive"]}}}}}}}}}
```

## DELETE /sites/{siteId}/cancellation-codes/{codeId}

> Delete a cancellation code.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/cancellation-codes/{codeId}":{"delete":{"tags":["Sites"],"description":"Delete a cancellation code.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"codeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["_id","deleted"]}}}}}}}}}
```

## PATCH /sites/{siteId}/cancellation-codes/{codeId}

> Update a cancellation code. Code is immutable and cannot be changed.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/cancellation-codes/{codeId}":{"patch":{"tags":["Sites"],"description":"Update a cancellation code. Code is immutable and cannot be changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"codeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","inactive"]}}}}}}}}}
```

## POST /sites/{siteId}/categories

> Create a new category 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":{"/sites/{siteId}/categories":{"post":{"tags":["Sites"],"description":"Create a new category for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","colour"],"properties":{"name":{"type":"string"},"colour":{"type":"string"}}}}}},"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"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","colour","created_at","updated_at"]}}}}}}}}}
```

## DELETE /sites/{siteId}/categories/{categoryId}

> Remove a category from a site. Reassigns incidents if needed, archives or fully deletes.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/categories/{categoryId}":{"delete":{"tags":["Sites"],"description":"Remove a category from a site. Reassigns incidents if needed, archives or fully deletes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reassign_to":{"type":"string"},"permanent":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"categoryId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["_id","name","colour"]}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"requires_reassignment":{"type":"boolean"},"incident_count":{"type":"number"}}}}}}}}}}}
```

## PATCH /sites/{siteId}/categories/{categoryId}

> Update a category 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":{"/sites/{siteId}/categories/{categoryId}":{"patch":{"tags":["Sites"],"description":"Update a category for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","colour"],"properties":{"name":{"type":"string"},"colour":{"type":"string"},"it_map_string":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"categoryId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"it_map_string":{"type":"string"}},"required":["_id","name","colour","created_at","updated_at"]}}}}}}}}}
```

## POST /sites/{siteId}/categories/{categoryId}/restore

> Restore an archived category back to a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/categories/{categoryId}/restore":{"post":{"tags":["Sites"],"description":"Restore an archived category back to a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"categoryId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"it_map_string":{"type":"string"}},"required":["_id","name","colour"]}}}}}}}}}
```

## GET /sites/

> Retrieve a list of sites the user has access to.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/":{"get":{"tags":["Sites"],"description":"Retrieve a list of sites the user has access to.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"logo_url":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","created_at","updated_at"]}}}}}}}}}}
```

## POST /sites/

> Create a new site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/":{"post":{"tags":["Sites"],"description":"Create a new site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"created_by":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","created_by","created_at","updated_at"]}}}}}}}}}
```

## POST /sites/{siteId}/flag-types

> Create a new flag type 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":{"/sites/{siteId}/flag-types":{"post":{"tags":["Sites"],"description":"Create a new flag type for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","colour"],"properties":{"name":{"type":"string"},"colour":{"type":"string"}}}}}},"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"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","colour","created_at","updated_at"]}}}}}}}}}
```

## DELETE /sites/{siteId}/flag-types/{flagTypeId}

> Remove a flag type from a site. Archives or fully deletes.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/flag-types/{flagTypeId}":{"delete":{"tags":["Sites"],"description":"Remove a flag type from a site. Archives or fully deletes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"permanent":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"flagTypeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["_id","name","colour"]}}}}}}}}}
```

## PATCH /sites/{siteId}/flag-types/{flagTypeId}

> Update a flag type 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":{"/sites/{siteId}/flag-types/{flagTypeId}":{"patch":{"tags":["Sites"],"description":"Update a flag type for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","colour"],"properties":{"name":{"type":"string"},"colour":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"flagTypeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","colour","created_at","updated_at"]}}}}}}}}}
```

## POST /sites/{siteId}/flag-types/{flagTypeId}/restore

> Restore an archived flag type back to a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/flag-types/{flagTypeId}/restore":{"post":{"tags":["Sites"],"description":"Restore an archived flag type back to a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"flagTypeId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","colour"]}}}}}}}}}
```

## GET /sites/{siteId}/housekeeping-tasks

> List housekeeping tasks 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":{"/sites/{siteId}/housekeeping-tasks":{"get":{"tags":["Sites"],"description":"List housekeeping tasks for a site.","parameters":[{"schema":{"type":"boolean","default":false},"in":"query","name":"include_inactive","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"instructions":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","instructions","sequence","inactive"]}}}}}}}}}}
```

## POST /sites/{siteId}/housekeeping-tasks

> Create a new housekeeping task 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":{"/sites/{siteId}/housekeeping-tasks":{"post":{"tags":["Sites"],"description":"Create a new housekeeping task for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","description"],"properties":{"code":{"type":"string","maxLength":16},"description":{"type":"string"},"instructions":{"type":"string"},"sequence":{"type":"number","default":0},"inactive":{"type":"boolean","default":false}}}}}},"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"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"instructions":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","instructions","sequence","inactive"]}}}}}}}}}
```

## DELETE /sites/{siteId}/housekeeping-tasks/{taskId}

> Delete a housekeeping task.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/housekeeping-tasks/{taskId}":{"delete":{"tags":["Sites"],"description":"Delete a housekeeping task.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"taskId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["_id","deleted"]}}}}}}}}}
```

## PATCH /sites/{siteId}/housekeeping-tasks/{taskId}

> Update a housekeeping task. Code is immutable and cannot be changed.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/housekeeping-tasks/{taskId}":{"patch":{"tags":["Sites"],"description":"Update a housekeeping task. Code is immutable and cannot be changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string"},"instructions":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"taskId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"instructions":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","instructions","sequence","inactive"]}}}}}}}}}
```

## POST /sites/{siteId}/incident-forms

> Create a new incident form 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":{"/sites/{siteId}/incident-forms":{"post":{"tags":["Sites"],"description":"Create a new incident form for a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## DELETE /sites/{siteId}/incident-forms/{formId}

> Delete an incident form 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":{"/sites/{siteId}/incident-forms/{formId}":{"delete":{"tags":["Sites"],"description":"Delete an incident form for a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"formId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## PATCH /sites/{siteId}/incident-forms/{formId}

> Update an incident form 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":{"/sites/{siteId}/incident-forms/{formId}":{"patch":{"tags":["Sites"],"description":"Update an incident form for a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"formId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## POST /sites/{siteId}/logo

> Generate a presigned URL for a site logo upload.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/logo":{"post":{"tags":["Sites"],"description":"Generate a presigned URL for a site logo upload.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content_type"],"properties":{"content_type":{"type":"string","enum":["image/png","image/jpeg","image/jpg","image/svg+xml","image/webp"]}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","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 /sites/{siteId}/logo

> Persist an uploaded site logo.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/logo":{"put":{"tags":["Sites"],"description":"Persist an uploaded site logo.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["object_id"],"properties":{"object_id":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"raw_url":{"type":"string"},"source_uri":{"type":"string"},"uploaded":{"type":"boolean"},"object_id":{"type":"string"}},"required":["raw_url","source_uri","uploaded","object_id"]}}}}}}}}}
```

## GET /sites/{siteId}/no-service-reasons

> List no-service reasons 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":{"/sites/{siteId}/no-service-reasons":{"get":{"tags":["Sites"],"description":"List no-service reasons for a site.","parameters":[{"schema":{"type":"boolean","default":false},"in":"query","name":"include_inactive","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","inactive"]}}}}}}}}}}
```

## POST /sites/{siteId}/no-service-reasons

> Create a new no-service reason 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":{"/sites/{siteId}/no-service-reasons":{"post":{"tags":["Sites"],"description":"Create a new no-service reason for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","description"],"properties":{"code":{"type":"string","maxLength":20},"description":{"type":"string","maxLength":2000},"sequence":{"type":"number","default":0},"inactive":{"type":"boolean","default":false}}}}}},"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"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","inactive"]}}}}}}}}}
```

## DELETE /sites/{siteId}/no-service-reasons/{reasonId}

> Delete a no-service reason.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/no-service-reasons/{reasonId}":{"delete":{"tags":["Sites"],"description":"Delete a no-service reason.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"reasonId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["_id","deleted"]}}}}}}}}}
```

## PATCH /sites/{siteId}/no-service-reasons/{reasonId}

> Update a no-service reason. Code is immutable and cannot be changed.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/no-service-reasons/{reasonId}":{"patch":{"tags":["Sites"],"description":"Update a no-service reason. Code is immutable and cannot be changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","maxLength":2000},"sequence":{"type":"number"},"inactive":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"reasonId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","inactive"]}}}}}}}}}
```

## GET /sites/{siteId}/out-of-order-reasons

> List out-of-order/out-of-service reasons 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":{"/sites/{siteId}/out-of-order-reasons":{"get":{"tags":["Sites"],"description":"List out-of-order/out-of-service reasons for a site.","parameters":[{"schema":{"type":"boolean","default":false},"in":"query","name":"include_inactive","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"type":{"type":"string","enum":["out_of_order","out_of_service"]},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","type","inactive"]}}}}}}}}}}
```

## POST /sites/{siteId}/out-of-order-reasons

> Create a new out-of-order reason 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":{"/sites/{siteId}/out-of-order-reasons":{"post":{"tags":["Sites"],"description":"Create a new out-of-order reason for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","description","type"],"properties":{"code":{"type":"string","maxLength":16},"description":{"type":"string"},"sequence":{"type":"number","default":0},"type":{"type":"string","enum":["out_of_order","out_of_service"]},"inactive":{"type":"boolean","default":false}}}}}},"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"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"type":{"type":"string","enum":["out_of_order","out_of_service"]},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","type","inactive"]}}}}}}}}}
```

## DELETE /sites/{siteId}/out-of-order-reasons/{reasonId}

> Delete an out-of-order reason.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/out-of-order-reasons/{reasonId}":{"delete":{"tags":["Sites"],"description":"Delete an out-of-order reason.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"reasonId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["_id","deleted"]}}}}}}}}}
```

## PATCH /sites/{siteId}/out-of-order-reasons/{reasonId}

> Update an out-of-order reason. Code is immutable and cannot be changed.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/out-of-order-reasons/{reasonId}":{"patch":{"tags":["Sites"],"description":"Update an out-of-order reason. Code is immutable and cannot be changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string"},"sequence":{"type":"number"},"type":{"type":"string","enum":["out_of_order","out_of_service"]},"inactive":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"reasonId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"type":{"type":"string","enum":["out_of_order","out_of_service"]},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","type","inactive"]}}}}}}}}}
```

## POST /sites/{siteId}/people/resolve

> Resolve a list of identifiers (student IDs and/or emails) to people in the site's tenant. Used by the bulk booking paste/upload flow to map raw input to person records.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/people/resolve":{"post":{"tags":["Sites"],"description":"Resolve a list of identifiers (student IDs and/or emails) to people in the site's tenant. Used by the bulk booking paste/upload flow to map raw input to person records.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identifiers"],"properties":{"identifiers":{"type":"array","minItems":1,"maxItems":2000,"items":{"type":"string"}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## POST /sites/{siteId}/priorities

> Create a new priority 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":{"/sites/{siteId}/priorities":{"post":{"tags":["Sites"],"description":"Create a new priority for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","colour"],"properties":{"name":{"type":"string"},"colour":{"type":"string"},"notify":{"type":"boolean"}}}}}},"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"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"notify":{"type":"boolean"}},"required":["_id","name","colour","created_at","updated_at","notify"]}}}}}}}}}
```

## DELETE /sites/{siteId}/priorities/{priorityId}

> Remove a priority from a site. Reassigns incidents if needed, archives or fully deletes.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/priorities/{priorityId}":{"delete":{"tags":["Sites"],"description":"Remove a priority from a site. Reassigns incidents if needed, archives or fully deletes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reassign_to":{"type":"string"},"permanent":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"priorityId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"notify":{"type":"boolean"},"deleted":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["_id","name","colour"]}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"requires_reassignment":{"type":"boolean"},"incident_count":{"type":"number"}}}}}}}}}}}
```

## PATCH /sites/{siteId}/priorities/{priorityId}

> Update a priority 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":{"/sites/{siteId}/priorities/{priorityId}":{"patch":{"tags":["Sites"],"description":"Update a priority for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","colour"],"properties":{"name":{"type":"string"},"colour":{"type":"string"},"notify":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"priorityId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"notify":{"type":"boolean"}},"required":["_id","name","colour","created_at","updated_at","notify"]}}}}}}}}}
```

## POST /sites/{siteId}/priorities/{priorityId}/restore

> Restore an archived priority back to a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/priorities/{priorityId}/restore":{"post":{"tags":["Sites"],"description":"Restore an archived priority back to a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"priorityId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"notify":{"type":"boolean"}},"required":["_id","name","colour"]}}}}}}}}}
```

## GET /sites/{siteId}

> Retrieve a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}":{"get":{"tags":["Sites"],"description":"Retrieve a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"created_by":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"incident_tracker_main_location_id":{"type":"string"},"default_status_pipeline":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"position":{"type":"number"},"is_terminal":{"type":"boolean"}}}},"categories":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"it_map_string":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"can_delete":{"type":"boolean"},"status_pipeline":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"position":{"type":"number"},"is_terminal":{"type":"boolean"}}}}},"required":["_id","name","colour"]}},"sources":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"can_delete":{"type":"boolean"}},"required":["_id","name","colour"]}},"priorities":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"archived":{"type":"boolean"},"notify":{"type":"boolean"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"can_delete":{"type":"boolean"}},"required":["_id","name","colour","archived","notify"]}},"archived_categories":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"it_map_string":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}}},"required":["_id","name","colour"]}},"archived_sources":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"can_delete":{"type":"boolean"}},"required":["_id","name","colour"]}},"archived_priorities":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"archived":{"type":"boolean"},"notify":{"type":"boolean"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}}},"required":["_id","name","colour"]}},"flag_types":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"can_delete":{"type":"boolean"}},"required":["_id","name","colour"]}},"welfare_states":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"can_delete":{"type":"boolean"}},"required":["_id","name","colour"]}},"archived_flag_types":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"can_delete":{"type":"boolean"}},"required":["_id","name","colour"]}},"archived_welfare_states":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"can_delete":{"type":"boolean"}},"required":["_id","name","colour"]}},"incident_forms":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"site":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"fields":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"label":{"type":"string"},"field_type":{"type":"string"},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string"}},"order":{"type":"number"}}}},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}},"photo_url":{"type":"string"},"logo_url":{"type":"string"},"permission":{"type":"string"}},"required":["name","created_by","created_at","updated_at","default_status_pipeline","categories","sources","priorities","permission"]}}}}}}}}}
```

## PATCH /sites/{siteId}

> Update a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}":{"patch":{"tags":["Sites"],"description":"Update a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"photo_url":{"type":"string"},"logo_url":{"type":"string"},"incident_tracker_main_location_id":{"type":"string"}}}}}},"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"},"name":{"type":"string"},"photo_url":{"type":"string"},"logo_url":{"type":"string"},"created_by":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"incident_tracker_main_location_id":{"type":"string"}},"required":["_id","name","created_by","created_at","updated_at"]}}}}}}}}}
```

## GET /sites/{siteId}/room-move-reasons

> List room move reasons 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":{"/sites/{siteId}/room-move-reasons":{"get":{"tags":["Sites"],"description":"List room move reasons for a site.","parameters":[{"schema":{"type":"boolean","default":false},"in":"query","name":"include_inactive","required":false},{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","inactive"]}}}}}}}}}}
```

## POST /sites/{siteId}/room-move-reasons

> Create a new room move reason 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":{"/sites/{siteId}/room-move-reasons":{"post":{"tags":["Sites"],"description":"Create a new room move reason for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","description"],"properties":{"code":{"type":"string","maxLength":16},"description":{"type":"string"},"sequence":{"type":"number","default":0},"inactive":{"type":"boolean","default":false}}}}}},"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"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","inactive"]}}}}}}}}}
```

## DELETE /sites/{siteId}/room-move-reasons/{reasonId}

> Delete a room move reason.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/room-move-reasons/{reasonId}":{"delete":{"tags":["Sites"],"description":"Delete a room move reason.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"reasonId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["_id","deleted"]}}}}}}}}}
```

## PATCH /sites/{siteId}/room-move-reasons/{reasonId}

> Update a room move reason. Code is immutable and cannot be changed.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/room-move-reasons/{reasonId}":{"patch":{"tags":["Sites"],"description":"Update a room move reason. Code is immutable and cannot be changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"reasonId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"site":{"type":"string"},"code":{"type":"string"},"description":{"type":"string"},"sequence":{"type":"number"},"inactive":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","code","description","sequence","inactive"]}}}}}}}}}
```

## POST /sites/{siteId}/sources

> Create a new source 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":{"/sites/{siteId}/sources":{"post":{"tags":["Sites"],"description":"Create a new source for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","colour"],"properties":{"name":{"type":"string"},"colour":{"type":"string"}}}}}},"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"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","colour","created_at","updated_at"]}}}}}}}}}
```

## DELETE /sites/{siteId}/sources/{sourceId}

> Remove a source from a site. Reassigns incidents if needed, archives or fully deletes.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/sources/{sourceId}":{"delete":{"tags":["Sites"],"description":"Remove a source from a site. Reassigns incidents if needed, archives or fully deletes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reassign_to":{"type":"string"},"permanent":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"sourceId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["_id","name","colour"]}}}},"409":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"requires_reassignment":{"type":"boolean"},"incident_count":{"type":"number"}}}}}}}}}}}
```

## PATCH /sites/{siteId}/sources/{sourceId}

> Update a source 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":{"/sites/{siteId}/sources/{sourceId}":{"patch":{"tags":["Sites"],"description":"Update a source for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","colour"],"properties":{"name":{"type":"string"},"colour":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"sourceId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","colour","created_at","updated_at"]}}}}}}}}}
```

## POST /sites/{siteId}/sources/{sourceId}/restore

> Restore an archived source back to a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/sources/{sourceId}/restore":{"post":{"tags":["Sites"],"description":"Restore an archived source back to a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"sourceId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","colour"]}}}}}}}}}
```

## GET /sites/{siteId}/status-pipeline

> Get the site default status pipeline.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/status-pipeline":{"get":{"tags":["Sites"],"description":"Get the site default status pipeline.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## PATCH /sites/{siteId}/status-pipeline

> Update the site default status pipeline.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/status-pipeline":{"patch":{"tags":["Sites"],"description":"Update the site default status pipeline.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["statuses"],"properties":{"statuses":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"position":{"type":"number"},"is_terminal":{"type":"boolean"}},"required":["key","name","colour","position","is_terminal"]}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## PATCH /sites/{siteId}/categories/{categoryId}/status-pipeline

> Set or clear a site-specific category status pipeline override.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/categories/{categoryId}/status-pipeline":{"patch":{"tags":["Sites"],"description":"Set or clear a site-specific category status pipeline override.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["statuses"],"properties":{"statuses":{"oneOf":[{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"position":{"type":"number"},"is_terminal":{"type":"boolean"}},"required":["key","name","colour","position","is_terminal"]}},{"type":"null"}]}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"categoryId","required":true}],"responses":{"200":{"description":"Default Response"}}}}}}
```

## POST /sites/{siteId}/welfare-states

> Create a new welfare state 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":{"/sites/{siteId}/welfare-states":{"post":{"tags":["Sites"],"description":"Create a new welfare state for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","colour"],"properties":{"name":{"type":"string"},"colour":{"type":"string"}}}}}},"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"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","colour","created_at","updated_at"]}}}}}}}}}
```

## DELETE /sites/{siteId}/welfare-states/{welfareStateId}

> Remove a welfare state from a site. Archives or fully deletes.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/welfare-states/{welfareStateId}":{"delete":{"tags":["Sites"],"description":"Remove a welfare state from a site. Archives or fully deletes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"permanent":{"type":"boolean"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"welfareStateId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["_id","name","colour"]}}}}}}}}}
```

## PATCH /sites/{siteId}/welfare-states/{welfareStateId}

> Update a welfare state 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":{"/sites/{siteId}/welfare-states/{welfareStateId}":{"patch":{"tags":["Sites"],"description":"Update a welfare state for a site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","colour"],"properties":{"name":{"type":"string"},"colour":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"welfareStateId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","colour","created_at","updated_at"]}}}}}}}}}
```

## POST /sites/{siteId}/welfare-states/{welfareStateId}/restore

> Restore an archived welfare state back to a site.

```json
{"openapi":"3.0.3","info":{"title":"Incident Tracker API","version":"1.0.0"},"servers":[{"url":"https://api.kitehouse.co.uk"}],"paths":{"/sites/{siteId}/welfare-states/{welfareStateId}/restore":{"post":{"tags":["Sites"],"description":"Restore an archived welfare state back to a site.","parameters":[{"schema":{"type":"string"},"in":"path","name":"siteId","required":true},{"schema":{"type":"string"},"in":"path","name":"welfareStateId","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"colour":{"type":"string"},"sites":{"type":"array","items":{"type":"string"}},"archived_sites":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["_id","name","colour"]}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kitehouse.co.uk/docs/api-reference/sites.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
