# Sites

## 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"]}}}}}}}}}
```

## 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"]}}}}}}}}}
```

## 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"]}}}}}}}}}
```

## 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"]}}}}}}}}}
```
